pub struct PathTree<T> {
pub node: Node<usize>,
/* private fields */
}
Expand description
A path tree.
Fields§
§node: Node<usize>
Implementations§
source§impl<T> PathTree<T>
impl<T> PathTree<T>
sourcepub fn insert(&mut self, path: &str, value: T) -> usize
pub fn insert(&mut self, path: &str, value: T) -> usize
Inserts a part path-value to the tree and returns the id.
sourcepub fn find<'a, 'b>(&'a self, path: &'b str) -> Option<(&'a T, Path<'a, 'b>)>
pub fn find<'a, 'b>(&'a self, path: &'b str) -> Option<(&'a T, Path<'a, 'b>)>
Returns the Path
by the given path.
sourcepub fn url_for(&self, index: usize, params: &[&str]) -> Option<String>
pub fn url_for(&self, index: usize, params: &[&str]) -> Option<String>
Generates URL with the params.
pub fn iter(&self) -> Iter<'_, (T, Vec<Piece>)>
Trait Implementations§
source§impl<'a, T> IntoIterator for &'a PathTree<T>
impl<'a, T> IntoIterator for &'a PathTree<T>
Auto Trait Implementations§
impl<T> Freeze for PathTree<T>
impl<T> RefUnwindSafe for PathTree<T>where
T: RefUnwindSafe,
impl<T> Send for PathTree<T>where
T: Send,
impl<T> Sync for PathTree<T>where
T: Sync,
impl<T> Unpin for PathTree<T>where
T: Unpin,
impl<T> UnwindSafe for PathTree<T>where
T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)