[−][src]Struct peepmatic_runtime::paths::PathInterner
An interner and de-duplicator for Path
s.
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]
fn default() -> PathInterner
[src]
impl<'de> Deserialize<'de> for PathInterner
[src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
impl Serialize for PathInterner
[src]
Auto Trait Implementations
impl !RefUnwindSafe for PathInterner
impl !Send for PathInterner
impl !Sync for PathInterner
impl Unpin for PathInterner
impl !UnwindSafe for PathInterner
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,