[][src]Enum runestick::ComponentRef

pub enum ComponentRef<'a> {
    Str(&'a str),
    Id(usize),
}

A reference to a component of an item.

All indexes refer to sibling indexes. So two sibling id components could have the indexes 1 and 2 respectively.

Variants

Str(&'a str)

A regular string component.

Id(usize)

A nested anonymous part with an identifier.

Implementations

impl<'_> ComponentRef<'_>[src]

pub fn id(self) -> Option<usize>[src]

Get the identifier of the component if it is an identifier component.

pub fn into_component(self) -> Component[src]

Convert into an owned component.

pub fn write_component(self, output: &mut Vec<u8>)[src]

Write the current component to the given vector.

pub fn hash_component<H>(self, hasher: &mut H) where
    H: Hasher
[src]

Hash the current component to the given hasher.

Trait Implementations

impl<'a> Clone for ComponentRef<'a>[src]

impl<'a> Copy for ComponentRef<'a>[src]

impl<'a> Debug for ComponentRef<'a>[src]

impl<'de: 'a, 'a> Deserialize<'de> for ComponentRef<'a>[src]

impl<'_> Display for ComponentRef<'_>[src]

impl<'a> Eq for ComponentRef<'a>[src]

impl<'a> Hash for ComponentRef<'a>[src]

impl<'_> IntoComponent for ComponentRef<'_>[src]

impl<'_, '_> IntoComponent for &'_ ComponentRef<'_>[src]

impl<'a> Ord for ComponentRef<'a>[src]

impl<'a> PartialEq<ComponentRef<'a>> for ComponentRef<'a>[src]

impl<'a> PartialOrd<ComponentRef<'a>> for ComponentRef<'a>[src]

impl<'a> Serialize for ComponentRef<'a>[src]

impl<'a> StructuralEq for ComponentRef<'a>[src]

impl<'a> StructuralPartialEq for ComponentRef<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for ComponentRef<'a>

impl<'a> Send for ComponentRef<'a>

impl<'a> Sync for ComponentRef<'a>

impl<'a> Unpin for ComponentRef<'a>

impl<'a> UnwindSafe for ComponentRef<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.