pub struct UserBuffersInputBuffer<'a, M> { /* private fields */ }Expand description
An InputBuffer that read data from user space memory through a TaskMemoryAccessor.
Implementations§
Source§impl<'a> UserBuffersInputBuffer<'a, CurrentTask>
impl<'a> UserBuffersInputBuffer<'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> UserBuffersInputBuffer<'a, Task>
impl<'a> UserBuffersInputBuffer<'a, Task>
pub fn syscall_new(task: &'a Task, buffers: UserBuffers) -> Result<Self, Errno>
Source§impl<'a> UserBuffersInputBuffer<'a, RemoteMemoryManager>
impl<'a> UserBuffersInputBuffer<'a, RemoteMemoryManager>
pub fn remote_new( mm: &'a RemoteMemoryManager, buffers: UserBuffers, ) -> Result<Self, Errno>
Trait Implementations§
Source§impl<'a, M: TaskMemoryAccessor> Buffer for UserBuffersInputBuffer<'a, M>
impl<'a, M: TaskMemoryAccessor> Buffer for UserBuffersInputBuffer<'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 UserBuffersInputBuffer<'a, M>
impl<'a, M> Debug for UserBuffersInputBuffer<'a, M>
Source§impl<'a, M: TaskMemoryAccessor> InputBuffer for UserBuffersInputBuffer<'a, M>
impl<'a, M: TaskMemoryAccessor> InputBuffer for UserBuffersInputBuffer<'a, M>
Source§fn peek(&mut self, uninit_bytes: &mut [MaybeUninit<u8>]) -> Result<usize, Errno>
fn peek(&mut self, uninit_bytes: &mut [MaybeUninit<u8>]) -> Result<usize, Errno>
Peeks the content of this buffer into
buffer.
If buffer is too small, the read will be partial.
If buffer is too large, the remaining bytes will be left untouched. Read moreSource§fn peek_each(
&mut self,
callback: &mut InputBufferCallback<'_>,
) -> Result<usize, Errno>
fn peek_each( &mut self, callback: &mut InputBufferCallback<'_>, ) -> Result<usize, Errno>
Calls
callback for each segment to peek data from. callback must returns the number of
bytes actually peeked. When it returns less than the size of the output buffer, the read
is stopped. Read moreSource§fn drain(&mut self) -> usize
fn drain(&mut self) -> usize
Clear the remaining content in the buffer. Returns the number of bytes swallowed. After this
method returns,
available() will returns 0. This does not touch the data in the buffer.Source§fn advance(&mut self, length: usize) -> Result<(), Errno>
fn advance(&mut self, length: usize) -> Result<(), Errno>
Consumes
length bytes of data from this buffer.Source§fn available(&self) -> usize
fn available(&self) -> usize
Returns the number of bytes available to be read from the buffer.
Source§fn bytes_read(&self) -> usize
fn bytes_read(&self) -> usize
Returns the number of bytes already read from the buffer.
Source§fn read_each(
&mut self,
callback: &mut InputBufferCallback<'_>,
) -> Result<usize, Errno>
fn read_each( &mut self, callback: &mut InputBufferCallback<'_>, ) -> Result<usize, Errno>
Calls
callback for each segment to read data from. callback must returns the number of
bytes actually read. When it returns less than the size of the output buffer, the read
is stopped. Read moreSource§fn read_all(&mut self) -> Result<Vec<u8>, Errno>
fn read_all(&mut self) -> Result<Vec<u8>, Errno>
Read all the remaining content in this buffer and returns it as a
Vec.Source§fn peek_all(&mut self) -> Result<Vec<u8>, Errno>
fn peek_all(&mut self) -> Result<Vec<u8>, Errno>
Peek all the remaining content in this buffer and returns it as a
Vec.Source§fn read(&mut self, buffer: &mut [MaybeUninit<u8>]) -> Result<usize, Errno>
fn read(&mut self, buffer: &mut [MaybeUninit<u8>]) -> Result<usize, Errno>
Write the content of this buffer into
buffer.
If buffer is too small, the read will be partial.
If buffer is too large, the remaining bytes will be left untouched. Read moreSource§fn read_exact(&mut self, buffer: &mut [MaybeUninit<u8>]) -> Result<usize, Errno>
fn read_exact(&mut self, buffer: &mut [MaybeUninit<u8>]) -> Result<usize, Errno>
Read the exact number of bytes required to fill buf. Read more
Auto Trait Implementations§
impl<'a, M> Freeze for UserBuffersInputBuffer<'a, M>
impl<'a, M> RefUnwindSafe for UserBuffersInputBuffer<'a, M>where
M: RefUnwindSafe,
impl<'a, M> Send for UserBuffersInputBuffer<'a, M>where
M: Sync,
impl<'a, M> Sync for UserBuffersInputBuffer<'a, M>where
M: Sync,
impl<'a, M> Unpin for UserBuffersInputBuffer<'a, M>
impl<'a, M> UnwindSafe for UserBuffersInputBuffer<'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,
Source§impl<T> InputBufferExt for Twhere
T: InputBuffer,
impl<T> InputBufferExt for Twhere
T: InputBuffer,
Source§fn read_to_vec_limited(&mut self, limit: usize) -> Result<Vec<u8>, Errno>
fn read_to_vec_limited(&mut self, limit: usize) -> Result<Vec<u8>, Errno>
Reads up to
limit bytes into a returned Vec.§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.