pub struct ObjectReference<'a> {
pub ld: &'a str,
pub ln: &'a str,
pub fc: Option<Fc>,
/* private fields */
}Expand description
A parsed IEC 61850 object reference: LDName/LNName.DO[.SDO][.DA[.BDA]], optionally
with a functional constraint in the MMS form LDName/LNName$FC$DO$DA.
Borrows the input; nothing is allocated.
Fields§
§ld: &'a strLogical device name (IEDNameLDInst or ldName).
ln: &'a strLogical node name (prefix + class + inst, e.g. LLN0, MMXU1).
fc: Option<Fc>Functional constraint if the reference was in MMS form.
Implementations§
Source§impl<'a> ObjectReference<'a>
impl<'a> ObjectReference<'a>
Sourcepub fn parse(s: &'a str) -> Result<Self, Error>
pub fn parse(s: &'a str) -> Result<Self, Error>
Parse either form. Returns an error for empty components or illegal characters.
Sourcepub fn path(&self) -> impl Iterator<Item = &'a str> + 'a
pub fn path(&self) -> impl Iterator<Item = &'a str> + 'a
The components below the LN (DO, SDO, DA, BDA …), in order.
Sourcepub fn selection(&self) -> Vec<Selector<'a>>
pub fn selection(&self) -> Vec<Selector<'a>>
The part of this reference that is not a name: the array index it selects and every component after it.
Empty for the ordinary reference, which names a variable and nothing inside it. A
non-empty one has to travel beside the name as an ISO 9506 alternateAccess, and a
caller that drops it reads a whole array where it asked for one element.
Sourcepub fn data_object(&self) -> Option<&'a str>
pub fn data_object(&self) -> Option<&'a str>
The data object (first path component), if any.
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Total length of the canonical dotted form, for the edition’s limit
(crate::common::Edition::max_object_reference_len).
Source§impl ObjectReference<'_>
impl ObjectReference<'_>
Sourcepub fn to_mms(&self, fc: Fc) -> (&str, String)
pub fn to_mms(&self, fc: Fc) -> (&str, String)
The MMS domain and item this reference maps to (IEC 61850-8-1 §7.3).
The logical device is the MMS domain and LN$FC$DO$DA is the item — the one
mapping every client service goes through, so it lives here rather than being spelt
out at each call site. A reference that already carries a functional constraint keeps
its own; fc is what a dotted reference is read with.
Sourcepub fn to_mms_under(&self, fc: Fc) -> (&str, String)
pub fn to_mms_under(&self, fc: Fc) -> (&str, String)
The same reference under a different functional constraint.
ObjectReference::to_mms keeps whatever constraint the reference itself carried,
which is what a caller naming one leaf wants. This is the other case: one data object
seen through two constraints. CSWI1$CO$Pos is the controllable object and
CSWI1$CF$Pos$ctlModel is how it was engineered, and a client holding the first has
to be able to ask for the second — which is exactly what stops it guessing the
control model and building a sequence the server answers with ObjectNotSelected.