Enum fuse_backend_rs::transport::Writer
source · pub enum Writer<'a, S: BitmapSlice = ()> {
FuseDev(FuseDevWriter<'a, S>),
Noop(PhantomData<&'a S>),
}
Expand description
Writer to send reply message to ’/dev/fuse` or virtiofs queue.
Variants§
FuseDev(FuseDevWriter<'a, S>)
Writer for FuseDev transport driver.
Noop(PhantomData<&'a S>)
Writer for Noop transport driver.
Implementations§
source§impl<'a, S: BitmapSlice> Writer<'a, S>
impl<'a, S: BitmapSlice> Writer<'a, S>
sourcepub fn write_from_at<F: FileReadWriteVolatile>(
&mut self,
src: F,
count: usize,
off: u64,
) -> Result<usize>
pub fn write_from_at<F: FileReadWriteVolatile>( &mut self, src: F, count: usize, off: u64, ) -> Result<usize>
Write data to the descriptor chain buffer from a File at offset off
.
Return the number of bytes written to the descriptor chain buffer.
sourcepub fn split_at(&mut self, offset: usize) -> Result<Self>
pub fn split_at(&mut self, offset: usize) -> Result<Self>
Split this Writer
into two at the given offset in the DescriptorChain
buffer.
After the split, self
will be able to write up to offset
bytes while the returned
Writer
can write up to available_bytes() - offset
bytes. Return an error if
offset > self.available_bytes()
.
sourcepub fn available_bytes(&self) -> usize
pub fn available_bytes(&self) -> usize
Return number of bytes available for writing.
May return an error if the combined lengths of all the buffers in the DescriptorChain would cause an overflow.
sourcepub fn bytes_written(&self) -> usize
pub fn bytes_written(&self) -> usize
Return number of bytes already written to the descriptor chain buffer.
Trait Implementations§
source§impl<'a, S: BitmapSlice> From<FuseDevWriter<'a, S>> for Writer<'a, S>
impl<'a, S: BitmapSlice> From<FuseDevWriter<'a, S>> for Writer<'a, S>
source§fn from(w: FuseDevWriter<'a, S>) -> Self
fn from(w: FuseDevWriter<'a, S>) -> Self
source§impl<'a, S: BitmapSlice> Write for Writer<'a, S>
impl<'a, S: BitmapSlice> Write for Writer<'a, S>
source§fn write(&mut self, buf: &[u8]) -> Result<usize>
fn write(&mut self, buf: &[u8]) -> Result<usize>
source§fn flush(&mut self) -> Result<()>
fn flush(&mut self) -> Result<()>
source§fn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
can_vector
)1.0.0 · source§fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
source§fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
write_all_vectored
)