Enum scir::InstancePathElement
source · pub enum InstancePathElement {
Id(InstanceId),
Name(ArcStr),
}
Expand description
An element of an InstancePath
.
Variants§
Implementations§
source§impl InstancePathElement
impl InstancePathElement
sourcepub fn unwrap_id(self) -> InstanceId
pub fn unwrap_id(self) -> InstanceId
Returns the value contained in this variant.
§Panics
Panics if the enum value is not of the expected variant.
sourcepub fn get_id(&self) -> Option<&InstanceId>
pub fn get_id(&self) -> Option<&InstanceId>
Returns a reference to the value contained in this variant.
Returns None
if the enum value is not of the expected variant.
sourcepub fn into_id(self) -> Option<InstanceId>
pub fn into_id(self) -> Option<InstanceId>
Returns the value contained in this variant.
Returns None
if the enum value is not of the expected variant.
sourcepub fn unwrap_name(self) -> ArcStr
pub fn unwrap_name(self) -> ArcStr
Returns the value contained in this variant.
§Panics
Panics if the enum value is not of the expected variant.
sourcepub fn get_name(&self) -> Option<&ArcStr>
pub fn get_name(&self) -> Option<&ArcStr>
Returns a reference to the value contained in this variant.
Returns None
if the enum value is not of the expected variant.
sourcepub fn into_name(self) -> Option<ArcStr>
pub fn into_name(self) -> Option<ArcStr>
Returns the value contained in this variant.
Returns None
if the enum value is not of the expected variant.
sourcepub fn as_ref(&self) -> InstancePathElementRef<&InstanceId, &ArcStr>
pub fn as_ref(&self) -> InstancePathElementRef<&InstanceId, &ArcStr>
Converts types to references.
For example, transforms a variant field with type T
to &T
.
sourcepub fn as_mut(&mut self) -> InstancePathElementRef<&mut InstanceId, &mut ArcStr>
pub fn as_mut(&mut self) -> InstancePathElementRef<&mut InstanceId, &mut ArcStr>
Converts types to mutable references.
For example, transforms a variant field with type T
to &mut T
.
Trait Implementations§
source§impl Clone for InstancePathElement
impl Clone for InstancePathElement
source§fn clone(&self) -> InstancePathElement
fn clone(&self) -> InstancePathElement
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for InstancePathElement
impl Debug for InstancePathElement
source§impl<'de> Deserialize<'de> for InstancePathElement
impl<'de> Deserialize<'de> for InstancePathElement
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl From<InstanceId> for InstancePathElement
impl From<InstanceId> for InstancePathElement
source§fn from(value: InstanceId) -> Self
fn from(value: InstanceId) -> Self
source§impl<S: Into<ArcStr>> From<S> for InstancePathElement
impl<S: Into<ArcStr>> From<S> for InstancePathElement
source§impl Hash for InstancePathElement
impl Hash for InstancePathElement
source§impl Ord for InstancePathElement
impl Ord for InstancePathElement
source§fn cmp(&self, other: &InstancePathElement) -> Ordering
fn cmp(&self, other: &InstancePathElement) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for InstancePathElement
impl PartialEq for InstancePathElement
source§fn eq(&self, other: &InstancePathElement) -> bool
fn eq(&self, other: &InstancePathElement) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for InstancePathElement
impl PartialOrd for InstancePathElement
source§fn partial_cmp(&self, other: &InstancePathElement) -> Option<Ordering>
fn partial_cmp(&self, other: &InstancePathElement) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for InstancePathElement
impl Serialize for InstancePathElement
impl Eq for InstancePathElement
impl StructuralPartialEq for InstancePathElement
Auto Trait Implementations§
impl RefUnwindSafe for InstancePathElement
impl Send for InstancePathElement
impl Sync for InstancePathElement
impl Unpin for InstancePathElement
impl UnwindSafe for InstancePathElement
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
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§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.