pub struct Trees<TC, BC = Vec<u64>> {
pub groups: BC,
pub bounds: BC,
pub values: TC,
}Expand description
A stand-in for Vec<Tree<T>>, with columnar storage for node values.
Nodes are stored in BFS order. groups tracks tree boundaries (cumulative
node counts with a leading 0). bounds tracks child ranges per node
(also with a leading 0 sentinel).
Fields§
§groups: BCCumulative node counts: tree i starts at node groups[i].
bounds: BCChild delimiters: node j’s children are at bounds[j]..bounds[j+1]
(root nodes use bounds[j]+1..bounds[j+1] to skip themselves).
values: TCColumnar container for node values in BFS order.
Implementations§
Trait Implementations§
Source§impl<TC: Borrow> Borrow for Trees<TC>
impl<TC: Borrow> Borrow for Trees<TC>
Source§type Ref<'a> = TreesRef<<TC as Borrow>::Borrowed<'a>, &'a [u64]>
where
TC: 'a
type Ref<'a> = TreesRef<<TC as Borrow>::Borrowed<'a>, &'a [u64]> where TC: 'a
For each lifetime, a reference with that lifetime. Read more
Source§type Borrowed<'a> = Trees<<TC as Borrow>::Borrowed<'a>, &'a [u64]>
where
TC: 'a
type Borrowed<'a> = Trees<<TC as Borrow>::Borrowed<'a>, &'a [u64]> where TC: 'a
The type of a borrowed container. Read more
Source§fn borrow<'a>(&'a self) -> Self::Borrowed<'a>
fn borrow<'a>(&'a self) -> Self::Borrowed<'a>
Converts a reference to the type to a borrowed variant. Read more
Source§fn reborrow<'b, 'a: 'b>(thing: Self::Borrowed<'a>) -> Self::Borrowed<'b>where
TC: 'a,
fn reborrow<'b, 'a: 'b>(thing: Self::Borrowed<'a>) -> Self::Borrowed<'b>where
TC: 'a,
Reborrows the borrowed type to a shorter lifetime. See
Columnar::reborrow for details.Source§fn reborrow_ref<'b, 'a: 'b>(thing: Self::Ref<'a>) -> Self::Ref<'b>where
Self: 'a,
fn reborrow_ref<'b, 'a: 'b>(thing: Self::Ref<'a>) -> Self::Ref<'b>where
Self: 'a,
Reborrows the borrowed type to a shorter lifetime. See
Columnar::reborrow for details.Source§impl<'a, TC: FromBytes<'a>, BC: FromBytes<'a>> FromBytes<'a> for Trees<TC, BC>
impl<'a, TC: FromBytes<'a>, BC: FromBytes<'a>> FromBytes<'a> for Trees<TC, BC>
Source§const SLICE_COUNT: usize
const SLICE_COUNT: usize
The number of byte slices this type consumes when reconstructed.
Source§fn from_bytes(bytes: &mut impl Iterator<Item = &'a [u8]>) -> Self
fn from_bytes(bytes: &mut impl Iterator<Item = &'a [u8]>) -> Self
Reconstructs
self from a sequence of correctly aligned and sized bytes slices. Read moreSource§fn from_store(store: &DecodedStore<'a>, offset: &mut usize) -> Self
fn from_store(store: &DecodedStore<'a>, offset: &mut usize) -> Self
Source§impl<'a, TC, BC: IndexAs<u64> + Len> Index for &'a Trees<TC, BC>
impl<'a, TC, BC: IndexAs<u64> + Len> Index for &'a Trees<TC, BC>
Source§impl<TC: Index + Copy, BC: IndexAs<u64> + Len + Copy> Index for Trees<TC, BC>
impl<TC: Index + Copy, BC: IndexAs<u64> + Len + Copy> Index for Trees<TC, BC>
impl<TC: Copy, BC: Copy> Copy for Trees<TC, BC>
Auto Trait Implementations§
impl<TC, BC> Freeze for Trees<TC, BC>
impl<TC, BC> RefUnwindSafe for Trees<TC, BC>where
BC: RefUnwindSafe,
TC: RefUnwindSafe,
impl<TC, BC> Send for Trees<TC, BC>
impl<TC, BC> Sync for Trees<TC, BC>
impl<TC, BC> Unpin for Trees<TC, BC>
impl<TC, BC> UnsafeUnpin for Trees<TC, BC>where
BC: UnsafeUnpin,
TC: UnsafeUnpin,
impl<TC, BC> UnwindSafe for Trees<TC, BC>where
BC: UnwindSafe,
TC: UnwindSafe,
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