Skip to main content

TreeLike

Trait TreeLike 

Source
pub trait TreeLike: Sized {
    type F: FileLike + Debug;

    // Required methods
    fn ids(&self) -> Vec<Uuid>;
    fn maybe_find(&self, id: &Uuid) -> Option<&Self::F>;

    // Provided methods
    fn find(&self, id: &Uuid) -> LbResult<&Self::F> { ... }
    fn maybe_find_parent<F2: FileLike>(&self, file: &F2) -> Option<&Self::F> { ... }
    fn find_parent<F2: FileLike>(&self, file: &F2) -> LbResult<&Self::F> { ... }
    fn all_files(&self) -> LbResult<Vec<&Self::F>> { ... }
    fn stage<Staged>(&self, staged: Staged) -> StagedTree<&Self, Staged>
       where Staged: TreeLike<F = Self::F>,
             Self: Sized { ... }
    fn to_staged<Staged>(self, staged: Staged) -> StagedTree<Self, Staged>
       where Staged: TreeLike<F = Self::F>,
             Self: Sized { ... }
    fn as_lazy(&self) -> LazyTree<&Self> { ... }
    fn to_lazy(self) -> LazyTree<Self> { ... }
}

Required Associated Types§

Required Methods§

Source

fn ids(&self) -> Vec<Uuid>

Source

fn maybe_find(&self, id: &Uuid) -> Option<&Self::F>

Provided Methods§

Source

fn find(&self, id: &Uuid) -> LbResult<&Self::F>

Source

fn maybe_find_parent<F2: FileLike>(&self, file: &F2) -> Option<&Self::F>

Source

fn find_parent<F2: FileLike>(&self, file: &F2) -> LbResult<&Self::F>

Source

fn all_files(&self) -> LbResult<Vec<&Self::F>>

Source

fn stage<Staged>(&self, staged: Staged) -> StagedTree<&Self, Staged>
where Staged: TreeLike<F = Self::F>, Self: Sized,

Source

fn to_staged<Staged>(self, staged: Staged) -> StagedTree<Self, Staged>
where Staged: TreeLike<F = Self::F>, Self: Sized,

Source

fn as_lazy(&self) -> LazyTree<&Self>

Source

fn to_lazy(self) -> LazyTree<Self>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<F> TreeLike for Option<F>
where F: FileLike,

Source§

type F = F

Source§

fn ids(&self) -> Vec<Uuid>

Source§

fn maybe_find(&self, id: &Uuid) -> Option<&F>

Source§

impl<F> TreeLike for Vec<F>
where F: FileLike,

Source§

type F = F

Source§

fn ids(&self) -> Vec<Uuid>

Source§

fn maybe_find(&self, id: &Uuid) -> Option<&F>

Source§

impl<F> TreeLike for HashMap<Uuid, F>
where F: FileLike,

Source§

type F = F

Source§

fn ids(&self) -> Vec<Uuid>

Source§

fn maybe_find(&self, id: &Uuid) -> Option<&F>

Source§

impl<F, S> TreeLike for LookupTable<Uuid, F, S>

Source§

type F = F

Source§

fn ids(&self) -> Vec<Uuid>

Source§

fn maybe_find(&self, id: &Uuid) -> Option<&Self::F>

Source§

impl<T> TreeLike for &T
where T: TreeLike,

Source§

type F = <T as TreeLike>::F

Source§

fn ids(&self) -> Vec<Uuid>

Source§

fn maybe_find(&self, id: &Uuid) -> Option<&Self::F>

Source§

impl<T> TreeLike for &mut T
where T: TreeLike,

Source§

type F = <T as TreeLike>::F

Source§

fn ids(&self) -> Vec<Uuid>

Source§

fn maybe_find(&self, id: &Uuid) -> Option<&Self::F>

Implementors§

Source§

impl TreeLike for ServerTree<'_>

Source§

impl<Base, Staged> TreeLike for StagedTree<Base, Staged>
where Base: TreeLike, Staged: TreeLike<F = Base::F>,

Source§

type F = <Base as TreeLike>::F

Source§

impl<T: TreeLike> TreeLike for LazyTree<T>

Source§

type F = <T as TreeLike>::F