bitstring_trees::tree

Trait TreeProperties

source
pub trait TreeProperties {
    type Key: BitString + Clone;
    type Value: Default;
    type LeafValue: Clone + Default;
    type LeafValueComparer: LeafValueComparer<Self::LeafValue>;

    const EMPTY: bool;
    const LEAF_EMPTY: bool;
    const IGNORE_LEAFS: bool;
}
Expand description

Define Tree behavior

Required Associated Constants§

source

const EMPTY: bool

Whether value is insignificant (inner nodes can be removed)

When true Value should be ().

source

const LEAF_EMPTY: bool

Whether leaf value is insignificant (leafs won’t cloned down a path to insert a new leaf - new leaf gets ignored if a parent leaf is present).

Most operations won’t touch the set of covered bitstrings by leaf nodes unless that is their explicit goal.

When true LeafValue should be ().

source

const IGNORE_LEAFS: bool

Whether to completely ignore leafs and the bitstrings they cover.

Use this if you only care about the inner Values.

If set LEAF_EMPTY must be set too.

Required Associated Types§

source

type Key: BitString + Clone

Bitstring key

source

type Value: Default

Value attached to all inner and leaf nodes

source

type LeafValue: Clone + Default

Value attached to leaf nodes only

source

type LeafValueComparer: LeafValueComparer<Self::LeafValue>

Used to compare leaf values to allow combining of leafs. (Only used when LEAF_EMPTY=false);

Object Safety§

This trait is not object safe.

Implementors§