Enum lazy_db::lazy_data::FileWrapper
source · 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
Auto Trait Implementations§
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