BstNode

Struct BstNode 

Source
pub struct BstNode<Data, Parent = WithNoParent<Data>> {
    pub data: Data,
    pub parent: Parent,
    pub child: [Option<NonNull<BstNode<Data, Parent>>>; 2],
}

Fields§

§data: Data§parent: Parent§child: [Option<NonNull<BstNode<Data, Parent>>>; 2]

Implementations§

Source§

impl<Data, Parent> BstNode<Data, Parent>
where Parent: Default,

Source

pub fn new(data: Data) -> Self

Examples found in repository?
crates/competitive/src/data_structure/binary_search_tree/node.rs (line 328)
324    pub fn from_data<A>(data: Spec::Data, allocator: &mut A) -> Self
325    where
326        A: Allocator<BstNode<Spec::Data, Spec::Parent>>,
327    {
328        Self::new(allocator.allocate(BstNode::new(data)))
329    }

Auto Trait Implementations§

§

impl<Data, Parent> Freeze for BstNode<Data, Parent>
where Data: Freeze, Parent: Freeze,

§

impl<Data, Parent> RefUnwindSafe for BstNode<Data, Parent>
where Data: RefUnwindSafe, Parent: RefUnwindSafe,

§

impl<Data, Parent = WithNoParent<Data>> !Send for BstNode<Data, Parent>

§

impl<Data, Parent = WithNoParent<Data>> !Sync for BstNode<Data, Parent>

§

impl<Data, Parent> Unpin for BstNode<Data, Parent>
where Data: Unpin, Parent: Unpin,

§

impl<Data, Parent> UnwindSafe for BstNode<Data, Parent>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.