Skip to main content

ObjectReference

Struct ObjectReference 

Source
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 str

Logical device name (IEDNameLDInst or ldName).

§ln: &'a str

Logical 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>

Source

pub fn parse(s: &'a str) -> Result<Self, Error>

Parse either form. Returns an error for empty components or illegal characters.

Source

pub fn path(&self) -> impl Iterator<Item = &'a str> + 'a

The components below the LN (DO, SDO, DA, BDA …), in order.

Source

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.

Source

pub fn data_object(&self) -> Option<&'a str>

The data object (first path component), if any.

Source

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

pub fn fits(&self, edition: Edition) -> bool

True when this reference fits the object-reference limit of edition.

Source§

impl ObjectReference<'_>

Source

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.

Source

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.

Trait Implementations§

Source§

impl<'a> Clone for ObjectReference<'a>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Copy for ObjectReference<'a>

Source§

impl<'a> Debug for ObjectReference<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for ObjectReference<'_>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Canonical dotted form; the MMS form if an FC is present.

Source§

impl<'a> Eq for ObjectReference<'a>

Source§

impl<'a> PartialEq for ObjectReference<'a>

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<'a> StructuralPartialEq for ObjectReference<'a>

Auto Trait Implementations§

§

impl<'a> Forget for ObjectReference<'a>

§

impl<'a> Freeze for ObjectReference<'a>
where &'a str: Freeze,

§

impl<'a> Move for ObjectReference<'a>

§

impl<'a> RefUnwindSafe for ObjectReference<'a>

§

impl<'a> Send for ObjectReference<'a>
where &'a str: Send,

§

impl<'a> Sync for ObjectReference<'a>

§

impl<'a> Unpin for ObjectReference<'a>
where &'a str: Unpin,

§

impl<'a> UnsafeUnpin for ObjectReference<'a>
where &'a str: UnsafeUnpin,

§

impl<'a> UnwindSafe for ObjectReference<'a>
where &'a str: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.