flow docs

This commit is contained in:
AF 2023-05-26 11:33:20 +00:00
parent 1c87e639d4
commit 8d435044cc
3 changed files with 17 additions and 0 deletions

View File

@ -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>>;
} }

View File

@ -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;

View File

@ -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::*;