pub struct VecOutputBuffer { /* private fields */ }Expand description
An OutputBuffer that write data to an internal buffer.
Implementations§
Trait Implementations§
Source§impl Buffer for VecOutputBuffer
impl Buffer for VecOutputBuffer
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 Debug for VecOutputBuffer
impl Debug for VecOutputBuffer
Source§impl From<VecOutputBuffer> for Vec<u8>
impl From<VecOutputBuffer> for Vec<u8>
Source§fn from(data: VecOutputBuffer) -> Self
fn from(data: VecOutputBuffer) -> Self
Converts to this type from the input type.
Source§impl OutputBuffer for VecOutputBuffer
impl OutputBuffer for VecOutputBuffer
Source§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(&mut self, buffer: &[u8]) -> Result<usize, Errno>
fn write(&mut self, buffer: &[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_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 Freeze for VecOutputBuffer
impl RefUnwindSafe for VecOutputBuffer
impl Send for VecOutputBuffer
impl Sync for VecOutputBuffer
impl Unpin for VecOutputBuffer
impl UnwindSafe for VecOutputBuffer
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.