#[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) -> DssReadLimits
pub fn max_include_bytes(self, bytes: usize) -> DssReadLimits
Set the bytes the read may pull in through includes.
Sourcepub fn max_properties(self, count: usize) -> DssReadLimits
pub fn max_properties(self, count: usize) -> DssReadLimits
Set the property assignments and edit records the read may retain.
Trait Implementations§
Source§impl Clone for DssReadLimits
impl Clone for DssReadLimits
Source§fn clone(&self) -> DssReadLimits
fn clone(&self) -> DssReadLimits
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for DssReadLimits
Source§impl Debug for DssReadLimits
impl Debug for DssReadLimits
Source§impl Default for DssReadLimits
impl Default for DssReadLimits
Source§fn default() -> DssReadLimits
fn default() -> DssReadLimits
impl Eq for DssReadLimits
Source§impl PartialEq for DssReadLimits
impl PartialEq for DssReadLimits
impl StructuralPartialEq for DssReadLimits
Auto Trait Implementations§
impl Freeze for DssReadLimits
impl RefUnwindSafe for DssReadLimits
impl Send for DssReadLimits
impl Sync for DssReadLimits
impl Unpin for DssReadLimits
impl UnsafeUnpin for DssReadLimits
impl UnwindSafe for DssReadLimits
Blanket Implementations§
impl<T> Allocation for T
impl<T> Boilerplate for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.