[][src]Struct librojo::path_map::PathMap

pub struct PathMap<T> { /* fields omitted */ }

A map from paths to another type, like instance IDs, with a bit of additional data that enables removing a path and all of its child paths from the tree more quickly.

Methods

impl<T> PathMap<T>[src]

pub fn new() -> PathMap<T>[src]

pub fn get(&self, path: &Path) -> Option<&T>[src]

pub fn get_mut(&mut self, path: &Path) -> Option<&mut T>[src]

pub fn insert(&mut self, path: PathBuf, value: T)[src]

pub fn remove(&mut self, root_path: &Path) -> Option<T>[src]

pub fn descend(&self, start_path: &Path, target_path: &Path) -> PathBuf[src]

Traverses the route between start_path and target_path and returns the path closest to target_path in the tree.

This is useful when trying to determine what paths need to be marked as altered when a change to a path is registered. Depending on the order of FS events, a file remove event could be followed by that file's directory being removed, in which case we should process that directory's parent.

Trait Implementations

impl<T: Debug> Debug for PathMap<T>[src]

impl<T> Default for PathMap<T>[src]

impl<T> Serialize for PathMap<T> where
    T: Serialize
[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for PathMap<T> where
    T: RefUnwindSafe

impl<T> Send for PathMap<T> where
    T: Send

impl<T> Sync for PathMap<T> where
    T: Sync

impl<T> Unpin for PathMap<T> where
    T: Unpin

impl<T> UnwindSafe for PathMap<T> where
    T: UnwindSafe

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

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

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

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,