pub struct File { /* private fields */ }Expand description
A read view of a file.
Can be used to recover data, or convert into a Writer.
Implementations§
Source§impl File
impl File
pub fn new<T: AsRawFd>(fd: T) -> Result<Self, Error>
Sourcepub fn recover(&self, cfg: &mut ConfigureFile) -> Option<FileDiscovery<'_>>
pub fn recover(&self, cfg: &mut ConfigureFile) -> Option<FileDiscovery<'_>>
Attempt to recover the configuration from existing data.
This method writes the read information into the output argument cfg and returns a proxy
with the recovered configuration. The proxy can be used to partially access the contained
entries as well, if the discovery succeeded.
Sourcepub fn configure(self, cfg: &ConfigureFile) -> Writer
pub fn configure(self, cfg: &ConfigureFile) -> Writer
Change the metadata of the file, to the one described in the configuration.
Sourcepub fn into_writer_unguarded(self) -> Writer
pub fn into_writer_unguarded(self) -> Writer
Convert this into a writer, without minding data consistency.
Auto Trait Implementations§
impl Freeze for File
impl RefUnwindSafe for File
impl Send for File
impl Sync for File
impl Unpin for File
impl UnwindSafe for File
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