#[non_exhaustive]pub enum TokenPurpose {
PasswordReset,
EmailVerification,
EmailChange,
EmailChangeCancel,
TwoFactorChallenge,
TwoFactorEmailCode,
}Expand description
What an AuthToken does when used. Stored as its snake_case name in a text column, so a
purpose a later release adds needs no migration.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
PasswordReset
A mailed link that sets a new password.
EmailVerification
A mailed link that proves the account reads the address it was mailed to.
EmailChange
A link mailed to a new address that makes it the account’s.
EmailChangeCancel
A link mailed to the old address that cancels a pending change.
TwoFactorChallenge
A sign-in whose password verified, waiting for its second factor.
TwoFactorEmailCode
A code mailed as a second factor, to sign in or to set the factor up.
Trait Implementations§
Source§impl Assign<TokenPurpose> for TokenPurpose
impl Assign<TokenPurpose> for TokenPurpose
Source§fn into_assignment(self) -> Assignment<TokenPurpose>
fn into_assignment(self) -> Assignment<TokenPurpose>
Convert into an [
Assignment<T>] value.Source§impl Clone for TokenPurpose
impl Clone for TokenPurpose
Source§fn clone(&self) -> TokenPurpose
fn clone(&self) -> TokenPurpose
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for TokenPurpose
Source§impl Debug for TokenPurpose
impl Debug for TokenPurpose
Source§impl Embed for TokenPurpose
impl Embed for TokenPurpose
impl Eq for TokenPurpose
Source§impl Field for TokenPurpose
impl Field for TokenPurpose
Source§type ExprTarget = TokenPurpose
type ExprTarget = TokenPurpose
The expression-level type of this field. Read more
Source§type Path<__Origin> = TokenPurposeFields<__Origin>
type Path<__Origin> = TokenPurposeFields<__Origin>
The type returned when accessing this field from a Fields struct.
For primitives, this is Path<Origin, Self>.
For embedded types, this is {Type}Fields.
Source§type ListPath<__Origin> = TokenPurposeListFields<__Origin>
type ListPath<__Origin> = TokenPurposeListFields<__Origin>
The type returned when accessing this field from a list Fields struct.
For primitives, this is Path<Origin, ListSelf::ExprTarget>.
For embedded types, this is {Type}ListFields.
Source§type Update<'a> = ()
type Update<'a> = ()
The type of the update builder for this field.
For embedded types, this is {Type}Update<’a>.
For primitives, this will be {Type}Update<’a> once implemented.
Source§type Inner = TokenPurpose
type Inner = TokenPurpose
The unwrapped type used for foreign key filter expressions.
Primitives map to themselves. Wrappers like
Option<T>, Box<T>,
Arc<T>, and Rc<T> map to T::Inner.Source§fn new_path<__Origin>(
path: Path<__Origin, TokenPurpose>,
) -> <TokenPurpose as Field>::Path<__Origin>
fn new_path<__Origin>( path: Path<__Origin, TokenPurpose>, ) -> <TokenPurpose as Field>::Path<__Origin>
Build a field path from a raw path of the field’s
[
Self::ExprTarget]. Read moreSource§fn new_list_path<__Origin>(
path: Path<__Origin, List<<TokenPurpose as Field>::ExprTarget>>,
) -> <TokenPurpose as Field>::ListPath<__Origin>
fn new_list_path<__Origin>( path: Path<__Origin, List<<TokenPurpose as Field>::ExprTarget>>, ) -> <TokenPurpose as Field>::ListPath<__Origin>
Build a list field path from a raw path.
For primitives, returns the path as-is.
For embedded types, wraps the path in a ListFields struct.
Source§fn new_update<'a>(
_assignments: &'a mut Assignments,
_projection: Projection,
) -> <TokenPurpose as Field>::Update<'a>
fn new_update<'a>( _assignments: &'a mut Assignments, _projection: Projection, ) -> <TokenPurpose as Field>::Update<'a>
Build an update builder from assignments and a projection.
For primitives, this returns
() (no builder).
For embedded types, this is overridden to construct the {Type}Update builder.Source§fn field_ty(storage_ty: Option<Type>) -> FieldTy
fn field_ty(storage_ty: Option<Type>) -> FieldTy
Returns the app-level field type for this primitive.
Default implementation returns a Primitive field type.
Embedded types override this to return Embedded field type.
Source§fn key_constraint<__Origin>(
&self,
target: Path<__Origin, <TokenPurpose as Field>::Inner>,
) -> Expr<bool>
fn key_constraint<__Origin>( &self, target: Path<__Origin, <TokenPurpose as Field>::Inner>, ) -> Expr<bool>
Build a boolean filter expression comparing this field value against
a target path. Used by generated belongs-to accessors to build FK
lookups. Read more
Source§impl IntoExpr<TokenPurpose> for TokenPurpose
impl IntoExpr<TokenPurpose> for TokenPurpose
Source§fn into_expr(self) -> Expr<TokenPurpose>
fn into_expr(self) -> Expr<TokenPurpose>
Source§fn by_ref(&self) -> Expr<TokenPurpose>
fn by_ref(&self) -> Expr<TokenPurpose>
Source§impl Load for TokenPurpose
impl Load for TokenPurpose
Source§fn load(value: Value) -> Result<TokenPurpose, Error>
fn load(value: Value) -> Result<TokenPurpose, Error>
Source§fn reload(target: &mut TokenPurpose, value: Value) -> Result<(), Error>
fn reload(target: &mut TokenPurpose, value: Value) -> Result<(), Error>
Reload the value in-place from a value returned by the database. Read more
§fn ty_relation() -> Type
fn ty_relation() -> Type
Returns the [
stmt::Type] used when this type appears as a relation
target. The default delegates to ty().§fn load_relation(value: Value) -> Result<Self::Output, Error>
fn load_relation(value: Value) -> Result<Self::Output, Error>
Deserialize a value that was loaded as a relation target. Read more
Source§impl PartialEq for TokenPurpose
impl PartialEq for TokenPurpose
impl Scalar for TokenPurpose
impl StructuralPartialEq for TokenPurpose
Auto Trait Implementations§
impl Freeze for TokenPurpose
impl RefUnwindSafe for TokenPurpose
impl Send for TokenPurpose
impl Sync for TokenPurpose
impl Unpin for TokenPurpose
impl UnsafeUnpin for TokenPurpose
impl UnwindSafe for TokenPurpose
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.