[−][src]Struct xaynet::message::Sum2Buffer
A wrapper around a buffer that contains a Sum2
message.
It provides getters and setters to access the different fields of the message safely.
Implementations
impl<T: AsRef<[u8]>> Sum2Buffer<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
Sum2Buffer
.
Errors
Fails if the bytes
are smaller than a minimal-sized sum2 message buffer.
pub fn new_unchecked(bytes: T) -> Self
[src]
Returns a Sum2Buffer
with the given bytes
without performing bound checks.
This means that accessing the message fields may panic.
pub fn check_buffer_length(&self) -> Result<(), DecodeError>
[src]
Performs bound checks for the various message fields on this buffer.
impl<T: AsMut<[u8]>> Sum2Buffer<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 mask_mut(&mut self) -> &mut [u8]
[src]
Gets a mutable reference to the mask field.
Panics
Accessing the field may panic if the buffer has not been checked before.
impl<'a, T: AsRef<[u8]> + ?Sized> Sum2Buffer<&'a T>
[src]
pub fn sum_signature(&self) -> &'a [u8]
[src]
Gets a reference to the sum signature field.
Panics
Accessing the field may panic if the buffer has not been checked before.
pub fn mask(&self) -> &'a [u8]
[src]
Gets a reference to the mask field.
Panics
Accessing the field may panic if the buffer has not been checked before.
Trait Implementations
impl<T: Clone> Clone for Sum2Buffer<T>
[src]
fn clone(&self) -> Sum2Buffer<T>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T: Debug> Debug for Sum2Buffer<T>
[src]
impl<T: Eq> Eq for Sum2Buffer<T>
[src]
impl<T: Hash> Hash for Sum2Buffer<T>
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<T: PartialEq> PartialEq<Sum2Buffer<T>> for Sum2Buffer<T>
[src]
fn eq(&self, other: &Sum2Buffer<T>) -> bool
[src]
fn ne(&self, other: &Sum2Buffer<T>) -> bool
[src]
impl<T> StructuralEq for Sum2Buffer<T>
[src]
impl<T> StructuralPartialEq for Sum2Buffer<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for Sum2Buffer<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for Sum2Buffer<T> where
T: Send,
T: Send,
impl<T> Sync for Sum2Buffer<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Sum2Buffer<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Sum2Buffer<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,
fn vzip(self) -> V
impl<T> WithSubscriber for T
[src]
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
[src]
S: Into<Dispatch>,