pub struct Compound { /* private fields */ }Expand description
A structured value with no identity of its own.
IEC 61970-552 serializes a Compound inline — rdf:parseType="Resource" inside the
property element that holds it — rather than as a reference, because it has no mRID to
point at. CGMES 3.0 uses this for postal addresses in the Geographical Location
profile (Location.mainAddress → StreetAddress → StreetDetail), and compounds
nest.
Storage mirrors Object: a vector sorted by AttrId, with repeats adjacent.
A compound carries no profile provenance of its own; it belongs to whichever
Slot holds it.
Implementations§
Source§impl Compound
impl Compound
pub fn new(class: ClassId) -> Compound
Sourcepub fn values(&self) -> &[(AttrId, Value)]
pub fn values(&self) -> &[(AttrId, Value)]
All stored (attribute, value) pairs, in attribute order.
pub fn is_empty(&self) -> bool
pub fn len(&self) -> usize
Sourcepub fn get_all(&self, attr: AttrId) -> &[(AttrId, Value)]
pub fn get_all(&self, attr: AttrId) -> &[(AttrId, Value)]
All values of attr, for many-valued fields.
Sourcepub fn all(&self, attr: AttrId) -> impl Iterator<Item = &Value>
pub fn all(&self, attr: AttrId) -> impl Iterator<Item = &Value>
Every value of attr — the uniform accessor generated views use.
pub fn has(&self, attr: AttrId) -> bool
pub fn count(&self, attr: AttrId) -> usize
Trait Implementations§
impl StructuralPartialEq for Compound
Auto Trait Implementations§
impl Forget for Compound
impl Freeze for Compound
impl Move for Compound
impl RefUnwindSafe for Compound
impl Send for Compound
impl Sync for Compound
impl Unpin for Compound
impl UnsafeUnpin for Compound
impl UnwindSafe for Compound
Blanket Implementations§
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
Mutably borrows from an owned value. Read more