[][src]Struct xaynet_core::message::UpdateBuffer

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

A wrapper around a buffer that contains an Update message.

It provides getters and setters to access the different fields of the message safely.

Implementations

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

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

Performs bound checks for the various message fields on bytes and returns a new UpdateBuffer.

Errors

Fails if the bytes are smaller than a minimal-sized update message buffer.

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

Returns an UpdateBuffer without performing any bound checks.

This means accessing the various fields may panic if the data is invalid.

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

Performs bound checks to ensure the fields can be accessed without panicking.

impl<'a, T: AsRef<[u8]> + ?Sized> UpdateBuffer<&'a T>[src]

pub fn sum_signature(&self) -> &'a [u8][src]

Gets the sum signature field.

Panics

Accessing the field may panic if the buffer has not been checked before.

pub fn update_signature(&self) -> &'a [u8][src]

Gets the update signature field.

Panics

Accessing the field may panic if the buffer has not been checked before.

pub fn masked_model(&self) -> &'a [u8][src]

Gets a slice that starts at the beginning of the masked model field.

Panics

Accessing the field may panic if the buffer has not been checked before.

pub fn masked_scalar(&self) -> &'a [u8][src]

Gets a slice that starts at the beginning of the masked scalar field.

Panics

Accessing the field may panic if the buffer has not been checked before.

pub fn local_seed_dict(&self) -> &'a [u8][src]

Gets a slice that starts at the beginning og the local seed dictionary field.

Panics

Accessing the field may panic if the buffer has not been checked before.

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

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

Gets a mutable reference to the sum signature field.

Panics

Accessing the field may panic if the buffer has not been checked before.

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

Gets a mutable reference to the update signature field.

Panics

Accessing the field may panic if the buffer has not been checked before.

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

Gets a mutable slice that starts at the beginning of the masked model field.

Panics

Accessing the field may panic if the buffer has not been checked before.

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

Gets a mutable slice that starts at the beginning of the masked scalar field.

Panics

Accessing the field may panic if the buffer has not been checked before.

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

Gets a mutable slice that starts at the beginning of the local seed dictionary field.

Panics

Accessing the field may panic if the buffer has not been checked before.

Trait Implementations

impl<T: Clone> Clone for UpdateBuffer<T>[src]

impl<T: Debug> Debug for UpdateBuffer<T>[src]

Auto Trait Implementations

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

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

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

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

impl<T> UnwindSafe for UpdateBuffer<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, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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>,