pub struct Header {
pub msgtype: u8,
pub psize: u32,
pub pubkey: [u8; 32],
pub nonce: [u8; 24],
pub encrypted: bool,
}
Expand description
Header
contains identifying information about the Job
that follows.
Specifically this contains the fields:
- msgtype, the
Job
type:u8
- psize, the following payload size in bytes as:
u32
- pubkey, the crypto-box pubkey of the sender as:
[u8; 32]
- nonce, the message nonce as:
[u8; 24]
- encrypted,
bool
indicating the encryption status of the following payload.
Fields§
§msgtype: u8
§psize: u32
§pubkey: [u8; 32]
§nonce: [u8; 24]
§encrypted: bool
Implementations§
source§impl Header
impl Header
sourcepub fn set_msgtype<T: Into<u8>>(self, msgtype: T) -> Header
pub fn set_msgtype<T: Into<u8>>(self, msgtype: T) -> Header
Sets the value of msgtype
.
sourcepub fn set_nonce<T: RngCore + CryptoRng>(
self,
csprng: &mut T
) -> Result<Header, RtjError>
pub fn set_nonce<T: RngCore + CryptoRng>( self, csprng: &mut T ) -> Result<Header, RtjError>
Sets the value of nonce
by generating one using the specified csprng.
sourcepub fn set_encrypted(self, encrypted: bool) -> Header
pub fn set_encrypted(self, encrypted: bool) -> Header
Sets the value of encrypted
.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Header
impl<'de> Deserialize<'de> for Header
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for Header
impl PartialEq for Header
source§impl PartialOrd for Header
impl PartialOrd for Header
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for Header
impl StructuralPartialEq for Header
Auto Trait Implementations§
impl Freeze for Header
impl RefUnwindSafe for Header
impl Send for Header
impl Sync for Header
impl Unpin for Header
impl UnwindSafe for Header
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