pub enum InputBuffer {
Owned(Vec<u8>),
}Expand description
Input abstraction: either a memory-mapped file or an owned in-memory buffer.
Variants§
Implementations§
Source§impl InputBuffer
impl InputBuffer
Sourcepub fn open(path: &Path, use_mmap: bool, prefault: bool) -> Result<Self>
pub fn open(path: &Path, use_mmap: bool, prefault: bool) -> Result<Self>
Open a path as an input buffer.
When use_mmap is true and the "mmap" feature is enabled, the file
is mapped. Otherwise it is read into an owned Vec<u8>.
pub fn as_slice(&self) -> &[u8] ⓘ
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Auto Trait Implementations§
impl Freeze for InputBuffer
impl RefUnwindSafe for InputBuffer
impl Send for InputBuffer
impl Sync for InputBuffer
impl Unpin for InputBuffer
impl UnsafeUnpin for InputBuffer
impl UnwindSafe for InputBuffer
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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