Skip to main content

CodeRecord

Struct CodeRecord 

Source
pub struct CodeRecord {
    pub id: CodeId,
    pub lookup_key: LookupKey,
    pub key_version: KeyVersion,
    pub purpose: Option<String>,
    pub scope: Option<String>,
    pub grant: Option<String>,
    pub expires_at: u64,
}
Expand description

Parameters for inserting a new code record.

Fields§

§id: CodeId

Storage identifier (caller-assigned; UUID recommended).

§lookup_key: LookupKey

Domain-separated HMAC of the normalized code (never the plaintext).

§key_version: KeyVersion

Key version that produced lookup_key.

§purpose: Option<String>

Optional host-owned purpose label (e.g. "redeem_invite").

§scope: Option<String>

Optional scope key (e.g. a community ID).

§grant: Option<String>

Optional opaque grant returned to the host after a won claim.

§expires_at: u64

Expiry as Unix seconds (UTC).

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.