pub struct TypedRef<T> { /* private fields */ }Expand description
A reference to an object of a known class, stored as its mRID.
CIM associations are serialized as identifiers, and exactly one side of each
association is written, so references are resolved through the dataset rather than
stored as pointers. TypedRef keeps the target class in the type so that resolving
it yields the right view without a cast.
Implementations§
Source§impl<'a, T: TypedView<'a>> TypedRef<T>
impl<'a, T: TypedView<'a>> TypedRef<T>
Sourcepub fn get(&self, dataset: &'a Dataset) -> Option<T>
pub fn get(&self, dataset: &'a Dataset) -> Option<T>
Resolve through dataset, returning None if the target is absent.
Sourcepub fn get_checked(&self, dataset: &'a Dataset) -> Option<T>
pub fn get_checked(&self, dataset: &'a Dataset) -> Option<T>
Resolve, checking that the target really is of the expected class.
Sourcepub fn is_resolvable(&self, dataset: &Dataset) -> bool
pub fn is_resolvable(&self, dataset: &Dataset) -> bool
Whether the target is present in dataset.
Trait Implementations§
impl<T: Eq> Eq for TypedRef<T>
impl<T: PartialEq> StructuralPartialEq for TypedRef<T>
Auto Trait Implementations§
impl<T> Forget for TypedRef<T>
impl<T> Freeze for TypedRef<T>
impl<T> Move for TypedRef<T>
impl<T> RefUnwindSafe for TypedRef<T>
impl<T> Send for TypedRef<T>
impl<T> Sync for TypedRef<T>
impl<T> Unpin for TypedRef<T>
impl<T> UnsafeUnpin for TypedRef<T>where
*const str is !null: UnsafeUnpin,
PhantomData<str>: UnsafeUnpin,
PhantomData<fn() -> T>: UnsafeUnpin,
impl<T> UnwindSafe for TypedRef<T>where
BoxRaw<str>: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.