[][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 entry<'a>(&'a mut self, path: PathBuf) -> Entry<'a, 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> Serialize for PathMap<T> where
    T: Serialize
[src]

Auto Trait Implementations

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

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

Blanket Implementations

impl<T> From for T
[src]

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

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

impl<T> Erased for T