Skip to main content

ResultTakeBuffer

Trait ResultTakeBuffer 

Source
pub trait ResultTakeBuffer {
    type Buffer;

    // Required method
    unsafe fn take_buffer(self) -> Result<Option<Self::Buffer>>;
}
Expand description

Helper trait for taking buffer from a BufResult.

Required Associated Types§

Source

type Buffer

Type of the buffer.

Required Methods§

Source

unsafe fn take_buffer(self) -> Result<Option<Self::Buffer>>

Call SetLen::advance_to if the result is Ok and return the buffer as result.

§Safety

The result value must be a valid length to advance to.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl ResultTakeBuffer for BufResult<usize, BufferRef>

Source§

impl<I: TakeBuffer<Buffer: IoBuf + SetLen>> ResultTakeBuffer for BufResult<usize, I>

Implementors§