pub struct FileChunkedIO { /* private fields */ }Expand description
File-based chunked I/O implementation.
Implementations§
Source§impl FileChunkedIO
impl FileChunkedIO
Sourcepub async fn new<P: AsRef<Path>>(
path: P,
strategy: ChunkStrategy,
) -> Result<Self>
pub async fn new<P: AsRef<Path>>( path: P, strategy: ChunkStrategy, ) -> Result<Self>
Create a new file-based chunked I/O.
Sourcepub async fn open_write(&mut self) -> Result<()>
pub async fn open_write(&mut self) -> Result<()>
Open the file for writing.
Sourcepub fn with_direct_io(self, enable: bool) -> Self
pub fn with_direct_io(self, enable: bool) -> Self
Enable direct I/O (platform-dependent).
Trait Implementations§
Source§impl ChunkedIO for FileChunkedIO
impl ChunkedIO for FileChunkedIO
Source§fn read_chunk<'life0, 'life1, 'async_trait>(
&'life0 mut self,
descriptor: &'life1 ChunkDescriptor,
) -> Pin<Box<dyn Future<Output = Result<Bytes>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn read_chunk<'life0, 'life1, 'async_trait>(
&'life0 mut self,
descriptor: &'life1 ChunkDescriptor,
) -> Pin<Box<dyn Future<Output = Result<Bytes>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Read a chunk at the specified offset.
Source§fn write_chunk<'life0, 'life1, 'async_trait>(
&'life0 mut self,
descriptor: &'life1 ChunkDescriptor,
data: Bytes,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn write_chunk<'life0, 'life1, 'async_trait>(
&'life0 mut self,
descriptor: &'life1 ChunkDescriptor,
data: Bytes,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Write a chunk at the specified offset.
Auto Trait Implementations§
impl !Freeze for FileChunkedIO
impl !RefUnwindSafe for FileChunkedIO
impl !UnwindSafe for FileChunkedIO
impl Send for FileChunkedIO
impl Sync for FileChunkedIO
impl Unpin for FileChunkedIO
impl UnsafeUnpin for FileChunkedIO
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