pub trait FileExt:
Send
+ Sync
+ 'static {
// Required methods
fn len(&self) -> Result<u64>;
fn write_at_vectored(
&self,
bufs: &[IoSlice<'_>],
offset: u64,
) -> Result<usize>;
fn write_at(&self, buf: &[u8], offset: u64) -> Result<usize>;
fn read_at(&self, buf: &mut [u8], offset: u64) -> Result<usize>;
fn sync_all(&self) -> Result<()>;
fn set_len(&self, len: u64) -> Result<()>;
fn read_exact_at_async<B: IoBufMut + Send + 'static>(
&self,
buf: B,
offset: u64,
) -> impl Future<Output = (B, Result<()>)> + Send;
fn read_at_async<B: IoBufMut + Send + 'static>(
&self,
buf: B,
offset: u64,
) -> impl Future<Output = (B, Result<usize>)> + Send;
fn write_all_at_async<B: IoBuf + Send + 'static>(
&self,
buf: B,
offset: u64,
) -> impl Future<Output = (B, Result<()>)> + Send;
// Provided methods
fn write_all_at(&self, buf: &[u8], offset: u64) -> Result<()> { ... }
fn read_exact_at(&self, buf: &mut [u8], offset: u64) -> Result<()> { ... }
fn cursor(&self, offset: u64) -> Cursor<'_, Self> ⓘ
where Self: Sized { ... }
}
Required Methods§
fn len(&self) -> Result<u64>
fn write_at_vectored(&self, bufs: &[IoSlice<'_>], offset: u64) -> Result<usize>
fn write_at(&self, buf: &[u8], offset: u64) -> Result<usize>
fn read_at(&self, buf: &mut [u8], offset: u64) -> Result<usize>
fn sync_all(&self) -> Result<()>
fn set_len(&self, len: u64) -> Result<()>
fn read_exact_at_async<B: IoBufMut + Send + 'static>( &self, buf: B, offset: u64, ) -> impl Future<Output = (B, Result<()>)> + Send
fn read_at_async<B: IoBufMut + Send + 'static>( &self, buf: B, offset: u64, ) -> impl Future<Output = (B, Result<usize>)> + Send
fn write_all_at_async<B: IoBuf + Send + 'static>( &self, buf: B, offset: u64, ) -> impl Future<Output = (B, Result<()>)> + Send
Provided Methods§
fn write_all_at(&self, buf: &[u8], offset: u64) -> Result<()>
fn read_exact_at(&self, buf: &mut [u8], offset: u64) -> Result<()>
fn cursor(&self, offset: u64) -> Cursor<'_, Self> ⓘwhere
Self: Sized,
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.