Struct fuse_backend_rs::transport::FuseDevWriter
source · pub struct FuseDevWriter<'a, S: BitmapSlice = ()> { /* private fields */ }Expand description
Writer to send FUSE reply to the FUSE driver.
There are a few special properties to follow:
- A fuse device request MUST be written to the fuse device in one shot.
- If the writer is split, a final commit() MUST be called to issue the device write operation.
- Concurrency, caller should not write to the writer concurrently.
Implementations§
source§impl<'a, S: BitmapSlice> FuseDevWriter<'a, S>
impl<'a, S: BitmapSlice> FuseDevWriter<'a, S>
sourcepub async fn async_write(&mut self, data: &[u8]) -> Result<usize>
pub async fn async_write(&mut self, data: &[u8]) -> Result<usize>
Write data from a buffer into this writer in asynchronous mode.
Return the number of bytes written to the writer.
sourcepub async fn async_write2(&mut self, data: &[u8], data2: &[u8]) -> Result<usize>
pub async fn async_write2(&mut self, data: &[u8], data2: &[u8]) -> Result<usize>
Write data from two buffers into this writer in asynchronous mode.
Return the number of bytes written to the writer.
sourcepub async fn async_write3(
&mut self,
data: &[u8],
data2: &[u8],
data3: &[u8]
) -> Result<usize>
pub async fn async_write3(
&mut self,
data: &[u8],
data2: &[u8],
data3: &[u8]
) -> Result<usize>
Write data from two buffers into this writer in asynchronous mode.
Return the number of bytes written to the writer.
sourcepub async fn async_write_all(&mut self, buf: &[u8]) -> Result<()>
pub async fn async_write_all(&mut self, buf: &[u8]) -> Result<()>
Attempts to write an entire buffer into this writer in asynchronous mode.
sourcepub async fn async_write_from_at<F: AsyncFileReadWriteVolatile>(
&mut self,
src: &F,
count: usize,
off: u64
) -> Result<usize>
pub async fn async_write_from_at<F: AsyncFileReadWriteVolatile>(
&mut self,
src: &F,
count: usize,
off: u64
) -> Result<usize>
Write data from a File at offset off to the writer in asynchronous mode.
Return the number of bytes written to the writer.
source§impl<'a, S: BitmapSlice + Default> FuseDevWriter<'a, S>
impl<'a, S: BitmapSlice + Default> FuseDevWriter<'a, S>
source§impl<'a, S: BitmapSlice> FuseDevWriter<'a, S>
impl<'a, S: BitmapSlice> FuseDevWriter<'a, S>
sourcepub fn split_at(&mut self, offset: usize) -> Result<FuseDevWriter<'a, S>>
pub fn split_at(&mut self, offset: usize) -> Result<FuseDevWriter<'a, S>>
Split the Writer at the given offset.
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. Returns an error if
offset > self.available_bytes().
sourcepub fn commit(&mut self, other: Option<&Writer<'a, S>>) -> Result<usize>
pub fn commit(&mut self, other: Option<&Writer<'a, S>>) -> Result<usize>
Compose the FUSE reply message and send the message to /dev/fuse.
sourcepub fn bytes_written(&self) -> usize
pub fn bytes_written(&self) -> usize
Return number of bytes already written to the internal buffer.
sourcepub fn available_bytes(&self) -> usize
pub fn available_bytes(&self) -> usize
Return number of bytes available for writing.
sourcepub fn write_obj<T: ByteValued>(&mut self, val: T) -> Result<()>
pub fn write_obj<T: ByteValued>(&mut self, val: T) -> Result<()>
Write an object to the writer.
sourcepub fn write_from<F: FileReadWriteVolatile>(
&mut self,
src: F,
count: usize
) -> Result<usize>
pub fn write_from<F: FileReadWriteVolatile>(
&mut self,
src: F,
count: usize
) -> Result<usize>
Write data to the writer from a file descriptor.
Return the number of bytes written to the writer.
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 writer from a File at offset off.
Return the number of bytes written to the writer.
sourcepub fn write_all_from<F: FileReadWriteVolatile>(
&mut self,
src: F,
count: usize
) -> Result<()>
pub fn write_all_from<F: FileReadWriteVolatile>(
&mut self,
src: F,
count: usize
) -> Result<()>
Write all data to the writer from a file descriptor.
Trait Implementations§
source§impl<'a, S: Debug + BitmapSlice> Debug for FuseDevWriter<'a, S>
impl<'a, S: Debug + BitmapSlice> Debug for FuseDevWriter<'a, S>
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: PartialEq + BitmapSlice> PartialEq<FuseDevWriter<'a, S>> for FuseDevWriter<'a, S>
impl<'a, S: PartialEq + BitmapSlice> PartialEq<FuseDevWriter<'a, S>> for FuseDevWriter<'a, S>
source§fn eq(&self, other: &FuseDevWriter<'a, S>) -> bool
fn eq(&self, other: &FuseDevWriter<'a, S>) -> bool
self and other values to be equal, and is used
by ==.source§impl<'a, S: BitmapSlice> Write for FuseDevWriter<'a, S>
impl<'a, S: BitmapSlice> Write for FuseDevWriter<'a, S>
source§fn flush(&mut self) -> Result<()>
fn flush(&mut self) -> Result<()>
As this writer can associate multiple writers by splitting, flush() can’t
flush them all. Disable it!
source§fn write(&mut self, data: &[u8]) -> Result<usize>
fn write(&mut self, data: &[u8]) -> Result<usize>
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)