Trait lb_rs::TreeLike

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

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

    // Provided methods
    fn find(&self, id: &Uuid) -> Result<&Self::F, SharedError> { ... }
    fn maybe_find_parent<F2>(&self, file: &F2) -> Option<&Self::F>
       where F2: FileLike { ... }
    fn find_parent<F2>(&self, file: &F2) -> Result<&Self::F, SharedError>
       where F2: FileLike { ... }
    fn owned_ids(&self) -> HashSet<Uuid> { ... }
    fn all_files(&self) -> Result<Vec<&Self::F>, SharedError> { ... }
    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) -> HashSet<&Uuid>

source

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

Provided Methods§

source

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

source

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

source

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

source

fn owned_ids(&self) -> HashSet<Uuid>

source

fn all_files(&self) -> Result<Vec<&Self::F>, SharedError>

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>

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

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

§

type F = F

source§

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

source§

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

source§

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

§

type F = F

source§

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

source§

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

source§

impl<F> TreeLike for LookupTable<Uuid, F>
where F: FileLike + Serialize,

§

type F = F

source§

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

source§

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

source§

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

§

type F = <T as TreeLike>::F

source§

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

source§

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

source§

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

§

type F = <T as TreeLike>::F

source§

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

source§

fn maybe_find(&self, id: &Uuid) -> Option<&<&mut T as TreeLike>::F>

Implementors§

source§

impl TreeLike for ServerTree<'_>

source§

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

§

type F = <Base as TreeLike>::F

source§

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

§

type F = <T as TreeLike>::F