pub struct Communication<T> {
pub type: T,
pub inner: Vec<u8>,
pub augmentation: Option<Vec<u8>>,
}Fields§
§type: T§inner: Vec<u8>§augmentation: Option<Vec<u8>>Implementations§
Source§impl<T> Communication<T>where
T: CommunicableType,
impl<T> Communication<T>where
T: CommunicableType,
pub fn new(type: T) -> Self
pub fn tag(self, csprng: &mut impl CryptoRngCore) -> (Self, Vec<u8>)
pub fn with_tag(self, tag: Vec<u8>) -> Self
pub fn with_augmentation(self, augmentation: Option<Vec<u8>>) -> Self
pub fn pad_to(self, length: usize) -> Self
pub fn from(type: T, inner: Vec<u8>, augmentation: Option<Vec<u8>>) -> Self
pub fn encode(self) -> Vec<u8> ⓘ
pub fn decode(bytes: impl AsRef<[u8]>) -> Result<Self, DecodeError>
Trait Implementations§
Source§impl<T: Clone> Clone for Communication<T>
impl<T: Clone> Clone for Communication<T>
Source§fn clone(&self) -> Communication<T>
fn clone(&self) -> Communication<T>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Debug> Debug for Communication<T>
impl<T: Debug> Debug for Communication<T>
Source§impl<T: PartialEq> PartialEq for Communication<T>
impl<T: PartialEq> PartialEq for Communication<T>
impl<T: Eq> Eq for Communication<T>
impl<T> StructuralPartialEq for Communication<T>
Auto Trait Implementations§
impl<T> Freeze for Communication<T>where
T: Freeze,
impl<T> RefUnwindSafe for Communication<T>where
T: RefUnwindSafe,
impl<T> Send for Communication<T>where
T: Send,
impl<T> Sync for Communication<T>where
T: Sync,
impl<T> Unpin for Communication<T>where
T: Unpin,
impl<T> UnwindSafe for Communication<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more