pub struct NodeWeights { /* private fields */ }Expand description
Weights to use when deciding between internal and leaf nodes.
This structure is initialized with a desired target depth, and every level advancing in the tree shifts the weights away from internal nodes and towards leaf nodes.
Implementations§
Source§impl NodeWeights
impl NodeWeights
pub fn fixed(target_height: i32) -> NodeWeights
pub fn randomized(max_height: i32, rng: &mut dyn Rng) -> NodeWeights
pub fn internal(&self) -> u32
pub fn leaf(&self) -> u32
pub fn next_level(&self) -> NodeWeights
pub fn gen_child<P: RandNode>(&self, rng: &mut dyn Rng) -> Box<P>
Trait Implementations§
Source§impl Clone for NodeWeights
impl Clone for NodeWeights
Source§fn clone(&self) -> NodeWeights
fn clone(&self) -> NodeWeights
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for NodeWeights
Auto Trait Implementations§
impl Freeze for NodeWeights
impl RefUnwindSafe for NodeWeights
impl Send for NodeWeights
impl Sync for NodeWeights
impl Unpin for NodeWeights
impl UnwindSafe for NodeWeights
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)