Skip to main content

Tag

Struct Tag 

Source
pub struct Tag<const N: usize>(/* private fields */);
Expand description

An authentication tag.

Implementations§

Source§

impl<const N: usize> Tag<N>

Source

pub const fn len(&self) -> usize

Returns its length in octets.

Source

pub const fn as_bytes(&self) -> &[u8; N]

Returns itself as a byte array.

Trait Implementations§

Source§

impl<const N: usize> AsRef<[u8]> for Tag<N>

Source§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<const N: usize> Clone for Tag<N>

Source§

fn clone(&self) -> Tag<N>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<const N: usize> ConstantTimeEq for Tag<N>

Source§

fn ct_eq(&self, other: &Self) -> Choice

Determine if two items are equal. Read more
Source§

fn ct_ne(&self, other: &Self) -> Choice

Determine if two items are NOT equal. Read more
Source§

impl<const N: usize> Debug for Tag<N>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<const N: usize> From<[u8; N]> for Tag<N>

Source§

fn from(tag: [u8; N]) -> Self

Converts to this type from the input type.
Source§

impl From<GenericArray<u8, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>>> for Tag<64>

Source§

fn from(tag: GenericArray<u8, U64>) -> Self

Converts to this type from the input type.
Source§

impl From<GenericArray<u8, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for Tag<32>

Source§

fn from(tag: GenericArray<u8, U32>) -> Self

Converts to this type from the input type.
Source§

impl From<GenericArray<u8, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B0>, B0>>> for Tag<48>

Source§

fn from(tag: GenericArray<u8, U48>) -> Self

Converts to this type from the input type.
Source§

impl<const N: usize> From<Tag<N>> for [u8; N]

Source§

fn from(tag: Tag<N>) -> Self

Converts to this type from the input type.
Source§

impl<const N: usize> TryFrom<&[u8]> for Tag<N>

Source§

type Error = TryFromSliceError

The type returned in the event of a conversion error.
Source§

fn try_from(tag: &[u8]) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> Copy for Tag<N>

Auto Trait Implementations§

§

impl<const N: usize> Freeze for Tag<N>

§

impl<const N: usize> RefUnwindSafe for Tag<N>

§

impl<const N: usize> Send for Tag<N>

§

impl<const N: usize> Sync for Tag<N>

§

impl<const N: usize> Unpin for Tag<N>

§

impl<const N: usize> UnwindSafe for Tag<N>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToHex for T
where T: AsRef<[u8]>,

Source§

type Output = T

A hexadecimal string.
Source§

fn to_hex(self) -> Hex<<T as ToHex>::Output>

Encodes itself as a hexadecimal string.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V