#[non_exhaustive]pub enum Component {
Crate(Box<str>),
Str(Box<str>),
Id(usize),
}
Expand description
The component of an item.
All indexes refer to sibling indexes. So two sibling id components could
have the indexes 1
and 2
respectively.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Crate(Box<str>)
A crate component.
Str(Box<str>)
A regular string component.
Id(usize)
A nested anonymous part with an identifier.
Implementations§
Source§impl Component
impl Component
Sourcepub fn as_component_ref(&self) -> ComponentRef<'_>
pub fn as_component_ref(&self) -> ComponentRef<'_>
Convert into component reference.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Component
impl<'de> Deserialize<'de> for Component
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Component, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Component, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl IntoComponent for &Component
impl IntoComponent for &Component
Source§fn as_component_ref(&self) -> ComponentRef<'_>
fn as_component_ref(&self) -> ComponentRef<'_>
Convert into a component directly.
Source§impl IntoComponent for Component
impl IntoComponent for Component
Source§fn as_component_ref(&self) -> ComponentRef<'_>
fn as_component_ref(&self) -> ComponentRef<'_>
Convert into a component directly.
Source§impl Ord for Component
impl Ord for Component
Source§impl PartialOrd for Component
impl PartialOrd for Component
Source§impl Serialize for Component
impl Serialize for Component
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Eq for Component
impl StructuralPartialEq for Component
Auto Trait Implementations§
impl Freeze for Component
impl RefUnwindSafe for Component
impl Send for Component
impl Sync for Component
impl Unpin for Component
impl UnwindSafe for Component
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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§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.