pub struct TreePages<T, const PAGE: usize> { /* private fields */ }Expand description
Pages in a B-tree keyed by page number.
Trait Implementations§
Source§impl<T, const PAGE: usize> PageStore<T, PAGE> for TreePages<T, PAGE>
impl<T, const PAGE: usize> PageStore<T, PAGE> for TreePages<T, PAGE>
Source§type Pages<'a> = Map<Range<'a, usize, Box<[T; PAGE]>>, fn((&'a usize, &'a Box<[T; PAGE]>)) -> (usize, &'a [T; PAGE])>where
T: 'a,
type Pages<'a> = Map<Range<'a, usize, Box<[T; PAGE]>>, fn((&'a usize, &'a Box<[T; PAGE]>)) -> (usize, &'a [T; PAGE])>where
T: 'a,
Iterator over
(page number, page) from pages.Source§type PagesMut<'a> = Map<RangeMut<'a, usize, Box<[T; PAGE]>>, fn((&'a usize, &'a mut Box<[T; PAGE]>)) -> (usize, &'a mut [T; PAGE])>where
T: 'a,
type PagesMut<'a> = Map<RangeMut<'a, usize, Box<[T; PAGE]>>, fn((&'a usize, &'a mut Box<[T; PAGE]>)) -> (usize, &'a mut [T; PAGE])>where
T: 'a,
Iterator over
(page number, page) from pages_mut.Source§type IntoPages = IntoIter<usize, Box<[T; PAGE]>>
type IntoPages = IntoIter<usize, Box<[T; PAGE]>>
Owning iterator over
(page number, page) from
into_pages.Source§fn get(&self, page: usize) -> Option<&[T; PAGE]>
fn get(&self, page: usize) -> Option<&[T; PAGE]>
The page with this number, if it is allocated.
Source§fn get_mut(&mut self, page: usize) -> Option<&mut [T; PAGE]>
fn get_mut(&mut self, page: usize) -> Option<&mut [T; PAGE]>
Mutable access to the page with this number, if it is allocated.
Source§fn get_or_alloc(&mut self, page: usize) -> &mut [T; PAGE]where
T: Default,
fn get_or_alloc(&mut self, page: usize) -> &mut [T; PAGE]where
T: Default,
The page with this number, allocating it (all slots
T::default())
if needed. Read moreSource§fn remove(&mut self, page: usize) -> Option<Box<[T; PAGE]>>
fn remove(&mut self, page: usize) -> Option<Box<[T; PAGE]>>
Removes the page with this number and returns it, if it was allocated.
Source§fn shrink_to_fit(&mut self)
fn shrink_to_fit(&mut self)
Releases directory memory that no allocated page needs.
Source§fn pages_mut(&mut self) -> Self::PagesMut<'_>
fn pages_mut(&mut self) -> Self::PagesMut<'_>
The allocated pages in ascending page-number order, mutably.
Source§fn pages_in(&self, numbers: RangeInclusive<usize>) -> Self::Pages<'_>
fn pages_in(&self, numbers: RangeInclusive<usize>) -> Self::Pages<'_>
The allocated pages numbered in
numbers, in ascending order. An
empty range (start above end, or exhausted by iteration) yields
nothing. Read moreSource§fn pages_in_mut(&mut self, numbers: RangeInclusive<usize>) -> Self::PagesMut<'_>
fn pages_in_mut(&mut self, numbers: RangeInclusive<usize>) -> Self::PagesMut<'_>
Like
pages_in, mutably.Source§fn into_pages(self) -> Self::IntoPages
fn into_pages(self) -> Self::IntoPages
Consumes the store and returns its pages in ascending page-number
order.
Auto Trait Implementations§
impl<T, const PAGE: usize> Forget for TreePages<T, PAGE>
impl<T, const PAGE: usize> Freeze for TreePages<T, PAGE>
impl<T, const PAGE: usize> Move for TreePages<T, PAGE>
impl<T, const PAGE: usize> RefUnwindSafe for TreePages<T, PAGE>
impl<T, const PAGE: usize> Send for TreePages<T, PAGE>
impl<T, const PAGE: usize> Sync for TreePages<T, PAGE>
impl<T, const PAGE: usize> Unpin for TreePages<T, PAGE>
impl<T, const PAGE: usize> UnsafeUnpin for TreePages<T, PAGE>
impl<T, const PAGE: usize> UnwindSafe for TreePages<T, PAGE>
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