pub struct NodeRef(/* private fields */);Expand description
Packed reference to a tree node.
The high bit discriminates internal (0) from leaf (1) so node
identity is a single 4-byte field — useful for cache-friendly
storage in NodeStore.
§Examples
use anomstream_core::ForestBuilder;
let forest = ForestBuilder::<2>::new()
.num_trees(50)
.sample_size(8)
.seed(1)
.build()
.unwrap();
for (tree, _, _) in forest.trees() {
assert!(tree.root().is_none()); // empty forest has no root yet
}Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for NodeRef
impl<'de> Deserialize<'de> for NodeRef
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for NodeRef
impl Ord for NodeRef
Source§impl PartialOrd for NodeRef
impl PartialOrd for NodeRef
impl Copy for NodeRef
impl Eq for NodeRef
impl StructuralPartialEq for NodeRef
Auto Trait Implementations§
impl Freeze for NodeRef
impl RefUnwindSafe for NodeRef
impl Send for NodeRef
impl Sync for NodeRef
impl Unpin for NodeRef
impl UnsafeUnpin for NodeRef
impl UnwindSafe for NodeRef
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§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more