Skip to main content

Node

Trait Node 

Source
pub trait Node<const B: usize>: Sized {
    // Required methods
    fn has_fulfilled(&self) -> bool;
    fn expand<'a, I>(&'a self, iter: I) -> Result<usize, BeamError>
       where I: Iterator<Item = &'a mut MaybeUninit<Self>>;
    fn evaluate(&self) -> u64;

    // Provided methods
    fn inflate(&mut self) { ... }
    fn estimate(&self) -> Option<usize> { ... }
}

Required Methods§

Source

fn has_fulfilled(&self) -> bool

Heuristic function returning node’s fulfillment status

Source

fn expand<'a, I>(&'a self, iter: I) -> Result<usize, BeamError>
where I: Iterator<Item = &'a mut MaybeUninit<Self>>,

Generate successor nodes and write them to buffer

Source

fn evaluate(&self) -> u64

Node’s score heuristics funciton for Beam::cycle

Provided Methods§

Source

fn inflate(&mut self)

Mutate nodes in Beam::node_buf to meet criteria for Node::expand

Source

fn estimate(&self) -> Option<usize>

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl<const B: usize> Node<B> for BspaNode