Enum homestar_invocation::task::instruction::Nonce
source · pub enum Nonce {
Nonce96(GenericArray<u8, U12>),
Nonce128(GenericArray<u8, U16>),
Empty,
}Expand description
Enumeration over allowed nonce types.
Variants§
Nonce96(GenericArray<u8, U12>)
96-bit, 12-byte nonce, e.g. xid.
Nonce128(GenericArray<u8, U16>)
128-bit, 16-byte nonce.
Empty
No Nonce attributed.
Implementations§
source§impl Nonce
impl Nonce
sourcepub fn is_nonce96(&self) -> bool
pub fn is_nonce96(&self) -> bool
Returns true if this is a Nonce::Nonce96, otherwise false
sourcepub fn as_nonce96_mut(&mut self) -> Option<&mut GenericArray<u8, U12>>
pub fn as_nonce96_mut(&mut self) -> Option<&mut GenericArray<u8, U12>>
Optionally returns mutable references to the inner fields if this is a Nonce::Nonce96, otherwise None
sourcepub fn as_nonce96(&self) -> Option<&GenericArray<u8, U12>>
pub fn as_nonce96(&self) -> Option<&GenericArray<u8, U12>>
Optionally returns references to the inner fields if this is a Nonce::Nonce96, otherwise None
sourcepub fn into_nonce96(self) -> Result<GenericArray<u8, U12>, Self>
pub fn into_nonce96(self) -> Result<GenericArray<u8, U12>, Self>
Returns the inner fields if this is a Nonce::Nonce96, otherwise returns back the enum in the Err case of the result
sourcepub fn is_nonce128(&self) -> bool
pub fn is_nonce128(&self) -> bool
Returns true if this is a Nonce::Nonce128, otherwise false
sourcepub fn as_nonce128_mut(&mut self) -> Option<&mut GenericArray<u8, U16>>
pub fn as_nonce128_mut(&mut self) -> Option<&mut GenericArray<u8, U16>>
Optionally returns mutable references to the inner fields if this is a Nonce::Nonce128, otherwise None
sourcepub fn as_nonce128(&self) -> Option<&GenericArray<u8, U16>>
pub fn as_nonce128(&self) -> Option<&GenericArray<u8, U16>>
Optionally returns references to the inner fields if this is a Nonce::Nonce128, otherwise None
sourcepub fn into_nonce128(self) -> Result<GenericArray<u8, U16>, Self>
pub fn into_nonce128(self) -> Result<GenericArray<u8, U16>, Self>
Returns the inner fields if this is a Nonce::Nonce128, otherwise returns back the enum in the Err case of the result
source§impl Nonce
impl Nonce
sourcepub fn generate() -> Self
pub fn generate() -> Self
Default generator, outputting a xid nonce, which is a 96-bit, 12-byte nonce.
sourcepub fn generate_128() -> Self
pub fn generate_128() -> Self
Generate a default, 128-bit, 16-byte nonce via Uuid::new_v4().
Trait Implementations§
source§impl<'de> Deserialize<'de> for Nonce
impl<'de> Deserialize<'de> for Nonce
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>,
source§impl PartialEq for Nonce
impl PartialEq for Nonce
impl StructuralPartialEq for Nonce
Auto Trait Implementations§
impl RefUnwindSafe for Nonce
impl Send for Nonce
impl Sync for Nonce
impl Unpin for Nonce
impl UnwindSafe for Nonce
Blanket Implementations§
source§impl<T> Base64Encode for Twhere
T: DagJson,
impl<T> Base64Encode for Twhere
T: DagJson,
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
source§impl<T> DagJson for Twhere
T: Serialize + DeserializeOwned,
impl<T> DagJson for Twhere
T: Serialize + DeserializeOwned,
source§impl<T> IntoSql for T
impl<T> IntoSql for T
source§fn into_sql<T>(self) -> Self::Expression
fn into_sql<T>(self) -> Self::Expression
self to an expression for Diesel’s query builder. Read moresource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
&self to an expression for Diesel’s query builder. Read more