flow
docs
This commit is contained in:
parent
1c87e639d4
commit
8d435044cc
@ -8,6 +8,7 @@ pub type TreeRc<'a, BT> = Rc<<BT as BinaryTrees<'a>>::Tree>;
|
|||||||
pub type KeyRc<'a, BT> = Rc<<BT as BinaryTrees<'a>>::Key>;
|
pub type KeyRc<'a, BT> = Rc<<BT as BinaryTrees<'a>>::Key>;
|
||||||
|
|
||||||
pub type Split<'a, BT> = (TreeRc<'a, BT>, TreeRc<'a, BT>, KeyRc<'a, BT>);
|
pub type Split<'a, BT> = (TreeRc<'a, BT>, TreeRc<'a, BT>, KeyRc<'a, BT>);
|
||||||
|
pub type KeySplit<'a, BT> = (TreeRc<'a, BT>, TreeRc<'a, BT>);
|
||||||
|
|
||||||
pub type Wrapped<'a, BT, A> = Wrap<'a, A, <BT as BinaryTrees<'a>>::T>;
|
pub type Wrapped<'a, BT, A> = Wrap<'a, A, <BT as BinaryTrees<'a>>::T>;
|
||||||
|
|
||||||
@ -27,4 +28,11 @@ pub trait BinaryTrees<'a>: 'a {
|
|||||||
fn resolve(reference: Self::Reference) -> Wrapped<'a, Self, NodeRc<'a, Self>>;
|
fn resolve(reference: Self::Reference) -> Wrapped<'a, Self, NodeRc<'a, Self>>;
|
||||||
fn equal(rhs: Self::Reference, lhs: Self::Reference) -> bool;
|
fn equal(rhs: Self::Reference, lhs: Self::Reference) -> bool;
|
||||||
fn refer(tree: Self::Tree) -> Option<ReferenceRc<'a, Self>>;
|
fn refer(tree: Self::Tree) -> Option<ReferenceRc<'a, Self>>;
|
||||||
|
fn join_key(
|
||||||
|
tl: Self::Tree,
|
||||||
|
key: KeyRc<'a, Self>,
|
||||||
|
tr: Self::Tree,
|
||||||
|
) -> Wrapped<'a, Self, TreeRc<'a, Self>>;
|
||||||
|
fn join(tl: Self::Tree, tr: Self::Tree) -> Wrapped<'a, Self, TreeRc<'a, Self>>;
|
||||||
|
fn split_key(tree: Self::Tree, key: KeyRc<'a, Self>) -> Wrapped<'a, Self, KeySplit<'a, Self>>;
|
||||||
}
|
}
|
||||||
|
@ -1,2 +1,7 @@
|
|||||||
|
//! Algorithms defined on traversible trees.
|
||||||
|
//!
|
||||||
|
//! These algorithms are restricted to queries given that the traits don't provide any way of
|
||||||
|
//! making new nodes.
|
||||||
|
|
||||||
pub mod contains;
|
pub mod contains;
|
||||||
pub mod subset;
|
pub mod subset;
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
//! Binary trees without balancing.
|
||||||
|
//!
|
||||||
|
//! Intended for testing.
|
||||||
|
|
||||||
use std::fmt::Display;
|
use std::fmt::Display;
|
||||||
|
|
||||||
use crate::func::*;
|
use crate::func::*;
|
||||||
|
Loading…
Reference in New Issue
Block a user