#[non_exhaustive]pub struct DssReadLimits {
pub max_include_bytes: usize,
pub max_properties: usize,
}Expand description
The two limits on one OpenDSS read that a large case can reach and a caller may raise.
Both bound the work and memory a script can demand, whatever its size on
disk: an include that redirects to itself is executed again on every load,
and one like= copies a whole property list. The defaults suit input the
caller does not trust. A case with several hundred thousand lines and
loads, such as a SMART-DS region, needs more than the defaults allow; a
caller that trusts the case and has the memory for it raises them:
use powerio_dist::dss::DssReadLimits;
let limits = DssReadLimits::default()
.max_include_bytes(1 << 30)
.max_properties(1 << 26);
assert!(limits.max_include_bytes > DssReadLimits::default().max_include_bytes);The other limits are fixed: 4,096 included files, 64 levels of include
nesting, and 65,536 retained records on any one object. A file source
also keeps its own limit on the bytes it acquires
([powerio_core::Source::acquisition_byte_limit]).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.max_include_bytes: usizeBytes the read may pull in through Redirect, Compile, Buscoords
and loadshape files together. A file executed twice is charged twice.
The root file is not charged. Once the total reaches the limit the
include that crossed it completes and every later one is refused with
READ.DSS.INCLUDE_BUDGET. Default: 64 MiB.
max_properties: usizeProperty assignments and edit records retained across every object,
together with the per-object work of commands that visit many objects
(BatchEdit, a Solve or CalcVoltageBases recorded against each
line). At the limit the read drops further assignments with
READ.DSS.VALUE_CLAMPED or stops with READ.DSS.INCLUDE_BUDGET.
Memory grows with the count: a region that retained 4.5 million read
with a peak of about 2.3 GB. Default: 4,194,304.
Implementations§
Source§impl DssReadLimits
impl DssReadLimits
Sourcepub fn max_include_bytes(self, bytes: usize) -> Self
pub fn max_include_bytes(self, bytes: usize) -> Self
Set the bytes the read may pull in through includes.
Sourcepub fn max_properties(self, count: usize) -> Self
pub fn max_properties(self, count: usize) -> Self
Set the property assignments and edit records the read may retain.