EmptyData

Struct EmptyData 

Source
pub struct EmptyData<__ContainerType>(/* private fields */);
Expand description

A data lense to manipulate byte slices.

Implementations§

Source§

impl<__ContainerType> EmptyData<__ContainerType>

Source

pub const fn sid_len() -> usize

Source

pub const fn ctr_len() -> usize

Source

pub const fn auth_len() -> usize

Source

pub fn check_size(len: usize) -> Result<(), RosenpassError>

Verify that len is sufficiently long to hold Self

Source§

impl<'a, __ContainerType> EmptyData<&'a __ContainerType>
where __ContainerType: Index<Range<usize>> + ?Sized,

Source

pub fn sid(&self) -> &__ContainerType::Output

Copied from RespHello

4 bytes long

Source

pub fn until_sid(&self) -> &__ContainerType::Output

The bytes until the [Self :: sid] field

Source

pub fn ctr(&self) -> &__ContainerType::Output

Nonce

8 bytes long

Source

pub fn until_ctr(&self) -> &__ContainerType::Output

The bytes until the [Self :: ctr] field

Source

pub fn auth(&self) -> &__ContainerType::Output

Empty encrypted message (just an auth tag)

[sodium :: AEAD_TAG_LEN] bytes long

Source

pub fn until_auth(&self) -> &__ContainerType::Output

The bytes until the [Self :: auth] field

Source

pub fn all_bytes(&self) -> &__ContainerType::Output

View into all bytes belonging to this Lense

Source§

impl<'a, __ContainerType> EmptyData<&'a mut __ContainerType>
where __ContainerType: IndexMut<Range<usize>> + ?Sized,

Source

pub fn sid(&self) -> &__ContainerType::Output

Copied from RespHello

4 bytes long

Source

pub fn until_sid(&self) -> &__ContainerType::Output

The bytes until the [Self :: sid] field

Source

pub fn ctr(&self) -> &__ContainerType::Output

Nonce

8 bytes long

Source

pub fn until_ctr(&self) -> &__ContainerType::Output

The bytes until the [Self :: ctr] field

Source

pub fn auth(&self) -> &__ContainerType::Output

Empty encrypted message (just an auth tag)

[sodium :: AEAD_TAG_LEN] bytes long

Source

pub fn until_auth(&self) -> &__ContainerType::Output

The bytes until the [Self :: auth] field

Source

pub fn sid_mut(&mut self) -> &mut __ContainerType::Output

Copied from RespHello

4 bytes long

Source

pub fn ctr_mut(&mut self) -> &mut __ContainerType::Output

Nonce

8 bytes long

Source

pub fn auth_mut(&mut self) -> &mut __ContainerType::Output

Empty encrypted message (just an auth tag)

[sodium :: AEAD_TAG_LEN] bytes long

Source

pub fn all_bytes(&self) -> &__ContainerType::Output

View into all bytes belonging to this Lense

Source

pub fn all_bytes_mut(&mut self) -> &mut __ContainerType::Output

View into all bytes belonging to this Lense

Trait Implementations§

Source§

impl<__ContainerType> LenseView for EmptyData<__ContainerType>

Source§

const LEN: usize = 28usize

Number of bytes required to store this type in binary format

Auto Trait Implementations§

§

impl<__ContainerType> Freeze for EmptyData<__ContainerType>
where __ContainerType: Freeze,

§

impl<__ContainerType> RefUnwindSafe for EmptyData<__ContainerType>
where __ContainerType: RefUnwindSafe,

§

impl<__ContainerType> Send for EmptyData<__ContainerType>
where __ContainerType: Send,

§

impl<__ContainerType> Sync for EmptyData<__ContainerType>
where __ContainerType: Sync,

§

impl<__ContainerType> Unpin for EmptyData<__ContainerType>
where __ContainerType: Unpin,

§

impl<__ContainerType> UnwindSafe for EmptyData<__ContainerType>
where __ContainerType: UnwindSafe,

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> 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, 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.