pub trait File: Debug + Send + Sync + Seek + Read + Write + 'static {
fn id(&self) -> Option<u64>;
fn path(&self) -> &Path;
fn length(&self) -> Result<u64, Error>;
fn synchronize(&mut self) -> Result<(), Error>;
fn close(self) -> Result<(), Error>;
}
Expand description
A generic file trait.
Required methods
Returns the unique ID of this file. Only unique within the manager it was opened from.
fn synchronize(&mut self) -> Result<(), Error>
fn synchronize(&mut self) -> Result<(), Error>
Synchronizes data and metadata to the final destination. This calls
std::fs::File::sync_all()
on files, which ensures all filesystem
metadata (such as newly allocated blocks) and data is synchronized to
the destination device.