pub struct TrustHeader {
pub version: u8,
pub msg_type: u8,
pub flags: u32,
pub length: u32,
pub checksum: u32,
pub request_id: Uuid,
pub tenant_id: Uuid,
pub signature: [u8; 32],
}Expand description
Trust Message Header (80 bytes) | Magic (2B) | Version (1B) | Type (1B) | Flags (4B) | Length (4B) | Checksum (4B) | | RequestID (16B) | TenantID (16B) | Signature (32B) | Flags:
- Bits 0-7: SDR Level
Fields§
§version: u8§msg_type: u8§flags: u32§length: u32§checksum: u32§request_id: Uuid§tenant_id: Uuid§signature: [u8; 32]Implementations§
Source§impl TrustHeader
impl TrustHeader
pub const SIZE: usize = 80
pub fn sdr_level(&self) -> Redundancy
pub fn set_sdr_level(&mut self, level: Redundancy)
pub fn sign(&mut self, secret: &[u8])
pub fn verify(&self, secret: &[u8]) -> bool
pub fn encode<B: BufMut>(&self, dst: B)
pub fn decode(src: &mut BytesMut) -> Result<Self, DsError>
Trait Implementations§
Source§impl Clone for TrustHeader
impl Clone for TrustHeader
Source§fn clone(&self) -> TrustHeader
fn clone(&self) -> TrustHeader
Returns a duplicate 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 Debug for TrustHeader
impl Debug for TrustHeader
Source§impl PartialEq for TrustHeader
impl PartialEq for TrustHeader
impl StructuralPartialEq for TrustHeader
Auto Trait Implementations§
impl Freeze for TrustHeader
impl RefUnwindSafe for TrustHeader
impl Send for TrustHeader
impl Sync for TrustHeader
impl Unpin for TrustHeader
impl UnsafeUnpin for TrustHeader
impl UnwindSafe for TrustHeader
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