[][src]Struct peepmatic_runtime::paths::PathInterner

pub struct PathInterner { /* fields omitted */ }

An interner and de-duplicator for Paths.

Can be serialized and deserialized while maintaining the same id to interned path mapping.

Implementations

impl PathInterner[src]

pub fn new() -> Self[src]

Construct a new, empty PathInterner.

pub fn intern<'a>(&mut self, path: Path<'a>) -> PathId[src]

Intern a path into this PathInterner, returning its canonical PathId.

If we've already interned this path before, then the existing id we already assigned to it is returned. If we've never seen this path before, then it is copied into this PathInterner and a new id is assigned to it.

pub fn lookup<'a>(&'a self, id: PathId) -> Path<'a>[src]

Lookup a previously interned path by id.

Trait Implementations

impl Debug for PathInterner[src]

impl Default for PathInterner[src]

impl<'de> Deserialize<'de> for PathInterner[src]

impl Serialize for PathInterner[src]

Auto Trait Implementations

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, 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.