Skip to main content

PrimitiveContext

Struct PrimitiveContext 

Source
pub struct PrimitiveContext { /* private fields */ }
Expand description

A simplistic owned primitive context

This is very simplistic in two ways:

  • While the context is self-referential in principle, it makes use of the known and simple linking structure, and fixes itself every time it is used.

  • It is only used through exclusive access, whereas actually a context might be used at the same time in different ways (once exclusively, many times shared, and unlike references they don’t conflict)

Implementations§

Source§

impl PrimitiveContext

Source

pub fn new_from_fresh_material(immutables: PrimitiveImmutables) -> Self

Create a new security context

§Security

The material in the immutables must never have been used before. For example, it may be material that has just been produced from an ACE OSCORE exchange to which this device contributed entropy.

Source

pub fn as_mut(&mut self) -> &mut oscore_context_t

Source

pub fn recipient_id(&self) -> &[u8]

Trait Implementations§

Source§

impl Debug for PrimitiveContext

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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> Same for T

Source§

type Output = T

Should always be Self
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.