pub enum FileWrapper {
Reader(BufReader<File>),
Writer(BufWriter<File>),
}
Variants§
Implementations§
Source§impl FileWrapper
impl FileWrapper
Sourcepub fn new_reader(file: File) -> Self
pub fn new_reader(file: File) -> Self
Constructs a new FileWrapper::Reader
varient
Sourcepub fn new_writer(file: File) -> Self
pub fn new_writer(file: File) -> Self
Constructs a new FileWrapper::Writer
varient
Sourcepub fn read(&mut self, length: usize) -> Result<Box<[u8]>, LDBError>
pub fn read(&mut self, length: usize) -> Result<Box<[u8]>, LDBError>
Reads a set amount of bytes from a file by padding out undefined portions with 0u8
pub fn read_opt(&mut self, length: usize) -> Result<Option<Box<[u8]>>, LDBError>
Auto Trait Implementations§
impl Freeze for FileWrapper
impl RefUnwindSafe for FileWrapper
impl Send for FileWrapper
impl Sync for FileWrapper
impl Unpin for FileWrapper
impl UnwindSafe for FileWrapper
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