Enum iroh_bytes::store::mem::MemFile
source · pub enum MemFile {
Immutable(Bytes),
Mutable(MutableMemFile),
}Expand description
A file like object that can be in readonly or writeable mode.
Variants§
Immutable(Bytes)
immutable data, used for complete entries
Mutable(MutableMemFile)
mutable data, used for partial entries
Trait Implementations§
source§impl AsyncSliceReader for MemFile
impl AsyncSliceReader for MemFile
§type ReadAtFuture<'a> = <BytesMut as AsyncSliceReader>::ReadAtFuture<'a>
type ReadAtFuture<'a> = <BytesMut as AsyncSliceReader>::ReadAtFuture<'a>
The future returned by read_at
source§fn read_at(&mut self, offset: u64, len: usize) -> Self::ReadAtFuture<'_>
fn read_at(&mut self, offset: u64, len: usize) -> Self::ReadAtFuture<'_>
Read the entire buffer at the given position. Read more
§type LenFuture<'a> = <BytesMut as AsyncSliceReader>::LenFuture<'a>
type LenFuture<'a> = <BytesMut as AsyncSliceReader>::LenFuture<'a>
The future returned by len
source§impl AsyncSliceWriter for MemFile
impl AsyncSliceWriter for MemFile
§type WriteAtFuture<'a> = Ready<Result<(), Error>>
type WriteAtFuture<'a> = Ready<Result<(), Error>>
The future returned by write_at
source§fn write_at(&mut self, offset: u64, data: &[u8]) -> Self::WriteAtFuture<'_>
fn write_at(&mut self, offset: u64, data: &[u8]) -> Self::WriteAtFuture<'_>
Write the entire slice at the given position. Read more
§type WriteBytesAtFuture<'a> = Ready<Result<(), Error>>
type WriteBytesAtFuture<'a> = Ready<Result<(), Error>>
The future returned by write_bytes_at
source§fn write_bytes_at(
&mut self,
offset: u64,
data: Bytes
) -> Self::WriteBytesAtFuture<'_>
fn write_bytes_at( &mut self, offset: u64, data: Bytes ) -> Self::WriteBytesAtFuture<'_>
Write the entire Bytes at the given position. Read more
§type SetLenFuture<'a> = Ready<Result<(), Error>>
type SetLenFuture<'a> = Ready<Result<(), Error>>
The future returned by set_len
source§fn set_len(&mut self, len: u64) -> Self::SetLenFuture<'_>
fn set_len(&mut self, len: u64) -> Self::SetLenFuture<'_>
Set the length of the underlying storage.
§type SyncFuture<'a> = Ready<Result<(), Error>>
type SyncFuture<'a> = Ready<Result<(), Error>>
The future returned by sync
source§fn sync(&mut self) -> Self::SyncFuture<'_>
fn sync(&mut self) -> Self::SyncFuture<'_>
Sync any buffers to the underlying storage.
source§impl From<MutableMemFile> for MemFile
impl From<MutableMemFile> for MemFile
source§fn from(value: MutableMemFile) -> Self
fn from(value: MutableMemFile) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl RefUnwindSafe for MemFile
impl Send for MemFile
impl Sync for MemFile
impl Unpin for MemFile
impl UnwindSafe for MemFile
Blanket Implementations§
source§impl<T> AsyncSliceReaderExt for Twhere
T: AsyncSliceReader,
impl<T> AsyncSliceReaderExt for Twhere
T: AsyncSliceReader,
source§fn read_to_end(&mut self) -> Self::ReadAtFuture<'_>
fn read_to_end(&mut self) -> Self::ReadAtFuture<'_>
Read the entire resource into a bytes::Bytes buffer, if possible.
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