pub struct MultiPagedRangeBuf { /* private fields */ }Implementations§
Source§impl MultiPagedRangeBuf
impl MultiPagedRangeBuf
pub fn from_range_buffer(count: usize, buf: Vec<u64>) -> Result<Self, Error>
pub fn new() -> Self
pub fn iter(&self) -> MultiPagedRangeIter<'_> ⓘ
pub fn range_count(&self) -> usize
pub fn first(&self) -> Option<PagedRange<'_>>
Sourcepub fn contiguous_aligned(&self) -> Option<PagedRange<'_>>
pub fn contiguous_aligned(&self) -> Option<PagedRange<'_>>
Validates that this multi range consists of exactly one range that is page aligned. Returns that range.
pub fn range_buffer(&self) -> &[u64]
Sourcepub fn push_range(&mut self, range: PagedRange<'_>)
pub fn push_range(&mut self, range: PagedRange<'_>)
Appends a new paged range to the buffer.
Sourcepub fn try_extend_with<E>(
&mut self,
len: usize,
count: usize,
f: impl FnOnce(&mut [u64]) -> Result<(), E>,
) -> Result<Result<(), Error>, E>
pub fn try_extend_with<E>( &mut self, len: usize, count: usize, f: impl FnOnce(&mut [u64]) -> Result<(), E>, ) -> Result<Result<(), Error>, E>
Attempts to extend the buffer by count ranges, requiring len u64
entries in total. f is called to fill in the newly allocated
buffer space.
If f returns an error, the buffer is restored to its
previous state and the error is propagated. If f returns Ok(()),
the newly added ranges are validated; if validation fails, the buffer
is restored and the validation error is returned inside Ok(Err(_)).
Trait Implementations§
Source§impl Clone for MultiPagedRangeBuf
impl Clone for MultiPagedRangeBuf
Source§fn clone(&self) -> MultiPagedRangeBuf
fn clone(&self) -> MultiPagedRangeBuf
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MultiPagedRangeBuf
impl Debug for MultiPagedRangeBuf
Source§impl Default for MultiPagedRangeBuf
impl Default for MultiPagedRangeBuf
Source§fn default() -> MultiPagedRangeBuf
fn default() -> MultiPagedRangeBuf
Returns the “default value” for a type. Read more
Source§impl<'a> FromIterator<PagedRange<'a>> for MultiPagedRangeBuf
impl<'a> FromIterator<PagedRange<'a>> for MultiPagedRangeBuf
Source§fn from_iter<I: IntoIterator<Item = PagedRange<'a>>>(
iter: I,
) -> MultiPagedRangeBuf
fn from_iter<I: IntoIterator<Item = PagedRange<'a>>>( iter: I, ) -> MultiPagedRangeBuf
Creates a value from an iterator. Read more
Source§impl<'a> IntoIterator for &'a MultiPagedRangeBuf
impl<'a> IntoIterator for &'a MultiPagedRangeBuf
Auto Trait Implementations§
impl Freeze for MultiPagedRangeBuf
impl RefUnwindSafe for MultiPagedRangeBuf
impl Send for MultiPagedRangeBuf
impl Sync for MultiPagedRangeBuf
impl Unpin for MultiPagedRangeBuf
impl UnwindSafe for MultiPagedRangeBuf
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