pub struct UserBuffersOutputBuffer<'a, M> { /* private fields */ }Expand description
An OutputBuffer that write data to user space memory through a TaskMemoryAccessor.
Implementations§
Source§impl<'a> UserBuffersOutputBuffer<'a, CurrentTask>
impl<'a> UserBuffersOutputBuffer<'a, CurrentTask>
pub fn unified_new( task: &'a CurrentTask, buffers: UserBuffers, ) -> Result<Self, Errno>
pub fn unified_new_at( task: &'a CurrentTask, address: UserAddress, length: usize, ) -> Result<Self, Errno>
Source§impl<'a> UserBuffersOutputBuffer<'a, Task>
impl<'a> UserBuffersOutputBuffer<'a, Task>
pub fn syscall_new(task: &'a Task, buffers: UserBuffers) -> Result<Self, Errno>
Source§impl<'a> UserBuffersOutputBuffer<'a, RemoteMemoryManager>
impl<'a> UserBuffersOutputBuffer<'a, RemoteMemoryManager>
pub fn remote_new( mm: &'a RemoteMemoryManager, buffers: UserBuffers, ) -> Result<Self, Errno>
Trait Implementations§
Source§impl<'a, M: TaskMemoryAccessor> Buffer for UserBuffersOutputBuffer<'a, M>
impl<'a, M: TaskMemoryAccessor> Buffer for UserBuffersOutputBuffer<'a, M>
Source§fn segments_count(&self) -> Result<usize, Errno>
fn segments_count(&self) -> Result<usize, Errno>
Returns the number of segments, if the buffer supports I/O directly
to/from individual segments.
Source§fn peek_each_segment(
&mut self,
callback: &mut PeekBufferSegmentsCallback<'_>,
) -> Result<(), Errno>
fn peek_each_segment( &mut self, callback: &mut PeekBufferSegmentsCallback<'_>, ) -> Result<(), Errno>
Calls the callback with each segment backing this buffer. Read more
Source§impl<'a, M> Debug for UserBuffersOutputBuffer<'a, M>
impl<'a, M> Debug for UserBuffersOutputBuffer<'a, M>
Source§impl<'a, M: TaskMemoryAccessor> OutputBuffer for UserBuffersOutputBuffer<'a, M>
impl<'a, M: TaskMemoryAccessor> OutputBuffer for UserBuffersOutputBuffer<'a, M>
Source§fn write(&mut self, bytes: &[u8]) -> Result<usize, Errno>
fn write(&mut self, bytes: &[u8]) -> Result<usize, Errno>
Write the content of
buffer into this buffer. If this buffer is too small, the write will
be partial. Read moreSource§fn write_each(
&mut self,
callback: &mut OutputBufferCallback<'_>,
) -> Result<usize, Errno>
fn write_each( &mut self, callback: &mut OutputBufferCallback<'_>, ) -> Result<usize, Errno>
Calls
callback for each segment to write data for. callback must returns the number of
bytes actually written. When it returns less than the size of the input buffer, the write
is stopped. Read moreSource§fn available(&self) -> usize
fn available(&self) -> usize
Returns the number of bytes available to be written into the buffer.
Source§fn bytes_written(&self) -> usize
fn bytes_written(&self) -> usize
Returns the number of bytes already written into the buffer.
Source§unsafe fn advance(&mut self, length: usize) -> Result<(), Errno>
unsafe fn advance(&mut self, length: usize) -> Result<(), Errno>
Advance the output buffer by
length bytes. Read moreSource§fn write_all(&mut self, buffer: &[u8]) -> Result<usize, Errno>
fn write_all(&mut self, buffer: &[u8]) -> Result<usize, Errno>
Write the content of
buffer into this buffer. It is an error to pass a buffer larger than
the number of bytes available in this buffer. In that case, the content of the buffer after
the operation is unspecified. Read moreSource§fn write_buffer(&mut self, input: &mut dyn InputBuffer) -> Result<usize, Errno>
fn write_buffer(&mut self, input: &mut dyn InputBuffer) -> Result<usize, Errno>
Write the content of the given
InputBuffer into this buffer. The number of bytes written
will be the smallest between the number of bytes available in this buffer and in the
InputBuffer. Read moreAuto Trait Implementations§
impl<'a, M> Freeze for UserBuffersOutputBuffer<'a, M>
impl<'a, M> RefUnwindSafe for UserBuffersOutputBuffer<'a, M>where
M: RefUnwindSafe,
impl<'a, M> Send for UserBuffersOutputBuffer<'a, M>where
M: Sync,
impl<'a, M> Sync for UserBuffersOutputBuffer<'a, M>where
M: Sync,
impl<'a, M> Unpin for UserBuffersOutputBuffer<'a, M>
impl<'a, M> UnwindSafe for UserBuffersOutputBuffer<'a, M>where
M: RefUnwindSafe,
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
Source§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<T> InstanceFromServiceTransport<T> for T
impl<T> InstanceFromServiceTransport<T> for T
§fn from_service_transport(handle: T) -> T
fn from_service_transport(handle: T) -> T
Converts the given service transport handle of type
T to [Self]Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T, U> MultiArchFrom<T> for Uwhere
U: From<T>,
impl<T, U> MultiArchFrom<T> for Uwhere
U: From<T>,
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T, U> TryIntoExt<U> for Twhere
U: TryFromExt<T>,
impl<T, U> TryIntoExt<U> for Twhere
U: TryFromExt<T>,
type Error = <U as TryFromExt<T>>::Error
§fn try_into_ext(self) -> Result<U, <T as TryIntoExt<U>>::Error>
fn try_into_ext(self) -> Result<U, <T as TryIntoExt<U>>::Error>
Tries to perform the conversion.