Skip to main content

StrideOpsExt

Trait StrideOpsExt 

Source
pub trait StrideOpsExt: StrideOps + Sealed {
    // Provided methods
    fn is_empty(&self) -> bool { ... }
    fn with_child(
        self,
        addr: u8,
        child: impl Into<Child<Self, Self::T>>,
    ) -> Self { ... }
    fn into_child(self) -> Child<Self, Self::T> { ... }
}
Expand description

Extension methods for nodes implementing StrideOps.

Provided Methods§

Source

fn is_empty(&self) -> bool

Report whether the node has no children and prefixes.

Source

fn with_child(self, addr: u8, child: impl Into<Child<Self, Self::T>>) -> Self

Return this node with the given child added.

Meant as sugar for easily constructing nodes directly.

§Examples
DefaultNode::EMPTY.with_child(
    0,
    DefaultNode::EMPTY
        .with_child(1, Child::Fringe(123))
        .into_child(),
);
Source

fn into_child(self) -> Child<Self, Self::T>

Wrap this node in a Child::Path.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl<T> StrideOpsExt for T
where T: StrideOps,