VistrMutPin

Struct VistrMutPin 

Source
pub struct VistrMutPin<'a, N> { /* private fields */ }
Expand description

Tree Iterator that returns a protected mutable reference to each node.

Implementations§

Source§

impl<'a, N> VistrMutPin<'a, N>

Source

pub fn borrow_mut(&mut self) -> VistrMutPin<'_, N>

It is safe to borrow the iterator and then produce mutable references from that as long as by the time the borrow ends, all the produced references also go away.

Source

pub fn borrow(&self) -> Vistr<'_, N>

Source

pub fn get_height(&self) -> usize

Source

pub fn into_slice(self) -> AabbPin<&'a mut [N]>

Trait Implementations§

Source§

impl<'a, N> FixedDepthVisitor for VistrMutPin<'a, N>

Source§

impl<'a, N> Visitor for VistrMutPin<'a, N>

Source§

type Item = AabbPin<&'a mut N>

The common item produced for both leafs and non leafs.
Source§

fn next(self) -> (Self::Item, Option<[Self; 2]>)

Consume this visitor, and produce the element it was pointing to along with it’s children visitors.
Source§

fn level_remaining_hint(&self) -> (usize, Option<usize>)

Return the levels remaining including the one that will be produced by consuming this iterator. So if you first made this object from the root for a tree of size 5, it should return 5. Think of is as height-depth. This is used to make good allocations when doing dfs and bfs. Defaults to (0,None)
Source§

fn dfs_preorder(self, func: impl FnMut(Self::Item))

Calls the closure in dfs preorder (root,left,right). Takes advantage of the callstack to do dfs.
Source§

fn with_depth(self, start_depth: Depth) -> LevelIter<Self>

Iterator Adapter to also produce the depth each iteration.
Source§

fn zip<F>(self, f: F) -> Zip<Self, F>
where F: Visitor,

Combine two tree visitors.
Source§

fn map<B, F>(self, func: F) -> Map<Self, F>
where F: Fn(Self::Item) -> B,

Map iterator adapter
Source§

fn take(self, num: usize) -> Take<Self>

Only produce children up to num.
Source§

fn flip(self) -> Flip<Self>

Flips left and right children.
Source§

fn dfs_preorder_iter(self) -> DfsPreOrderIter<Self>

Provides a dfs preorder iterator. Unlike the callback version, This one relies on dynamic allocation for its stack.
Source§

fn dfs_inorder_iter(self) -> DfsInOrderIter<Self>

Source§

fn dfs_inorder(self, func: impl FnMut(Self::Item))

Calls the closure in dfs preorder (left,right,root). Takes advantage of the callstack to do dfs.
Source§

fn dfs_postorder(self, func: impl FnMut(Self::Item))

Calls the closure in dfs preorder (left,right,root). Takes advantage of the callstack to do dfs.

Auto Trait Implementations§

§

impl<'a, N> Freeze for VistrMutPin<'a, N>

§

impl<'a, N> RefUnwindSafe for VistrMutPin<'a, N>
where N: RefUnwindSafe,

§

impl<'a, N> Send for VistrMutPin<'a, N>
where N: Send,

§

impl<'a, N> Sync for VistrMutPin<'a, N>
where N: Sync,

§

impl<'a, N> Unpin for VistrMutPin<'a, N>

§

impl<'a, N> !UnwindSafe for VistrMutPin<'a, N>

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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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.