Skip to main content

Buffer

Struct Buffer 

Source
pub struct Buffer {
    pub chunks: Vec<Uint64>,
    pub handles: Vec<NullableHandle>,
}
Expand description

A channel buffer that contains handles and chunks.

Fields§

§chunks: Vec<Uint64>

The chunks of the buffer.

§handles: Vec<NullableHandle>

The handles of the buffer.

Implementations§

Source§

impl Buffer

Source

pub fn new() -> Buffer

New buffer.

Trait Implementations§

Source§

impl<'de> AsDecoder<'de> for Buffer

Source§

type Decoder = BufferDecoder<'de>

The borrowed decoder type.
Source§

fn as_decoder(&'de mut self) -> <Buffer as AsDecoder<'de>>::Decoder

Borrowes this value as a decoder.
Source§

impl Default for Buffer

Source§

fn default() -> Buffer

Returns the “default value” for a type. Read more
Source§

impl Encoder for Buffer

Source§

fn bytes_written(&self) -> usize

Returns the number of bytes written to the encoder.
Source§

fn write_zeroes(&mut self, len: usize)

Writes zeroed bytes to the end of the encoder. Read more
Source§

fn write(&mut self, bytes: &[u8])

Copies bytes to the end of the encoder. Read more
Source§

fn rewrite(&mut self, pos: usize, bytes: &[u8])

Rewrites bytes at a position in the encoder.
Source§

impl HandleEncoder for Buffer

Source§

fn push_handle(&mut self, handle: NullableHandle) -> Result<(), EncodeError>

Pushes a handle into the encoder.
Source§

fn handles_pushed(&self) -> usize

Returns the number of handles added to the encoder.
Source§

impl InternalHandleEncoder for Buffer

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<D> AsDecoderExt for D
where D: for<'de> AsDecoder<'de>,

Source§

fn into_decoded<T>(self) -> Result<Decoded<T, D>, DecodeError>
where D: for<'de> AsDecoder<'de>, T: Wire<Constraint = ()>, <T as Wire>::Narrowed<'de>: for<'de> Decode<<D as AsDecoder<'de>>::Decoder, Constraint = ()>,

Decodes a value from the decoder and finishes it. Read more
Source§

fn into_decoded_with_constraint<T>( self, constraint: <T as Constrained>::Constraint, ) -> Result<Decoded<T, D>, DecodeError>
where D: for<'de> AsDecoder<'de>, T: Wire, <T as Wire>::Narrowed<'de>: for<'de> Decode<<D as AsDecoder<'de>>::Decoder, Constraint = <T as Constrained>::Constraint>,

Decodes a value from the decoder and finishes it. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T, D> Encode<Ambiguous1, D> for T
where D: ResourceDialect,

§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _offset: usize, _depth: Depth, ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
§

impl<T, D> Encode<Ambiguous2, D> for T
where D: ResourceDialect,

§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _offset: usize, _depth: Depth, ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
Source§

impl<E> EncoderExt for E
where E: Encoder + ?Sized,

Source§

fn preallocate<T>(&mut self, len: usize) -> Preallocated<'_, E, T>

Pre-allocates space for a slice of elements.
Source§

fn encode_next_iter<W, T>( &mut self, values: impl ExactSizeIterator<Item = T>, ) -> Result<(), EncodeError>
where W: Wire<Constraint = ()>, T: Encode<W, E>,

Encodes an iterator of elements. Read more
Source§

fn encode_next_iter_with_constraint<W, T>( &mut self, values: impl ExactSizeIterator<Item = T>, constraint: <W as Constrained>::Constraint, ) -> Result<(), EncodeError>
where W: Wire, T: Encode<W, E>,

Encodes an iterator of elements. Read more
Source§

fn encode_next<W, T>(&mut self, value: T) -> Result<(), EncodeError>
where W: Wire<Constraint = ()>, T: Encode<W, E>,

Encodes a value. Read more
Source§

fn encode_next_with_constraint<W, T>( &mut self, value: T, constraint: <W as Constrained>::Constraint, ) -> Result<(), EncodeError>
where W: Wire, T: Encode<W, E>,

Encodes a value with a constraint. Read more
Source§

fn encode<W, T>(value: T) -> Result<E, EncodeError>
where E: Default, W: Wire<Constraint = ()>, T: Encode<W, E>,

Encodes a value into a new instance of the encoder. Read more
Source§

fn encode_with_constraint<W, T>( value: T, constraint: <W as Constrained>::Constraint, ) -> Result<E, EncodeError>
where E: Default, W: Wire, T: Encode<W, E>,

Encodes a value with a constraint into a new instance of the encoder. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> InstanceFromServiceTransport<T> for T

Source§

fn from_service_transport(handle: T) -> T

Converts the given service transport handle of type T to Self
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<E> RunsTransport<Mpsc> for E

Source§

impl<E> RunsTransport<Mpsc> for E
where E: RunsTransport<Mpsc>,