#[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<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::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§fn into_component(self) -> Result<Component>
fn into_component(self) -> Result<Component>
Convert into component.
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§fn into_component(self) -> Result<Component>
fn into_component(self) -> Result<Component>
Convert into component.
Source§impl Ord for Component
impl Ord for Component
Source§impl PartialOrd for Component
impl PartialOrd for Component
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