[][src]Enum parity_bytes::BytesRef

pub enum BytesRef<'a> {
    Flexible(&'a mut Bytes),
    Fixed(&'a mut [u8]),
}

A byte collection reference that can either be a slice or a vector

Variants

Flexible(&'a mut Bytes)

This is a reference to a vector

This is a reference to a slice

Methods

impl<'a> BytesRef<'a>[src]

pub fn write(&mut self, offset: usize, input: &[u8]) -> usize[src]

Writes given input to this BytesRef starting at offset. Returns number of bytes written to the ref. NOTE can return number greater then input.len() in case flexible vector had to be extended.

Trait Implementations

impl<'a> Deref for BytesRef<'a>[src]

type Target = [u8]

The resulting type after dereferencing.

impl<'a> DerefMut for BytesRef<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for BytesRef<'a>

impl<'a> Send for BytesRef<'a>

impl<'a> Sync for BytesRef<'a>

impl<'a> Unpin for BytesRef<'a>

impl<'a> !UnwindSafe for BytesRef<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.