[][src]Struct xaynet::mask::MaskObjectBuffer

pub struct MaskObjectBuffer<T> { /* fields omitted */ }

A buffer for serialized mask objects.

Implementations

impl<T: AsRef<[u8]>> MaskObjectBuffer<T>[src]

pub fn new(bytes: T) -> Result<Self, DecodeError>[src]

Creates a new buffer from bytes.

Errors

Fails if the bytes don't conform to the required buffer length for mask objects.

pub fn new_unchecked(bytes: T) -> Self[src]

Creates a new buffer from bytes.

pub fn check_buffer_length(&self) -> Result<(), DecodeError>[src]

Checks if this buffer conforms to the required buffer length for mask objects.

Errors

Fails if the buffer is too small.

pub fn len(&self) -> usize[src]

Gets the expected number of bytes of this buffer wrt to the masking configuration.

Panics

Panics if the serialized masking configuration is invalid.

pub fn numbers(&self) -> usize[src]

Gets the number of serialized mask object elements.

Panics

May panic if this buffer is unchecked.

Panics if the number can't be represented as usize on targets smaller than 32 bits.

pub fn config(&self) -> &[u8][src]

Gets the serialized masking configuration.

Panics

May panic if this buffer is unchecked.

pub fn data(&self) -> &[u8][src]

Gets the serialized mask object elements.

Panics

May panic if this buffer is unchecked.

impl<T: AsRef<[u8]> + AsMut<[u8]>> MaskObjectBuffer<T>[src]

pub fn set_numbers(&mut self, value: u32)[src]

Sets the number of serialized mask object elements.

Panics

May panic if this buffer is unchecked.

pub fn config_mut(&mut self) -> &mut [u8][src]

Gets the serialized masking configuration.

Panics

May panic if this buffer is unchecked.

pub fn data_mut(&mut self) -> &mut [u8][src]

Gets the serialized mask object elements.

Panics

May panic if this buffer is unchecked.

Auto Trait Implementations

impl<T> RefUnwindSafe for MaskObjectBuffer<T> where
    T: RefUnwindSafe

impl<T> Send for MaskObjectBuffer<T> where
    T: Send

impl<T> Sync for MaskObjectBuffer<T> where
    T: Sync

impl<T> Unpin for MaskObjectBuffer<T> where
    T: Unpin

impl<T> UnwindSafe for MaskObjectBuffer<T> where
    T: UnwindSafe

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> Instrument for T[src]

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> WithSubscriber for T[src]