pub struct AuthThrottle {
pub key: String,
pub scope: String,
pub attempts: i64,
pub since: Timestamp,
}Expand description
Shipped sign-in throttle record: how many attempts one login made from one address since the
window began, for a LoginThrottle that counts in the database.
Fields§
§key: StringHex-encoded SHA-256 of the throttle, the login and the address, so the table holds no login in the clear.
scope: StringThe panel’s prefix and what the throttle counts, such as /admin:sign-in.
attempts: i64§since: TimestampWhen the window began: the first attempt it counts.
Implementations§
Source§impl AuthThrottle
impl AuthThrottle
Sourcepub fn fields() -> AuthThrottleFields<AuthThrottle>
pub fn fields() -> AuthThrottleFields<AuthThrottle>
Returns a handle used to reference AuthThrottle’s fields when building query expressions.
Sourcepub async fn get_by_key(
executor: &mut dyn Executor,
key: impl IntoExpr<FieldExprTarget<String>>,
) -> Result<AuthThrottle>
pub async fn get_by_key( executor: &mut dyn Executor, key: impl IntoExpr<FieldExprTarget<String>>, ) -> Result<AuthThrottle>
Fetches the single AuthThrottle where key matches, erroring if none exists.
Sourcepub fn update_by_key(
key: impl IntoExpr<FieldExprTarget<String>>,
) -> AuthThrottleUpdate
pub fn update_by_key( key: impl IntoExpr<FieldExprTarget<String>>, ) -> AuthThrottleUpdate
Returns a builder that updates the AuthThrottle where key matches.
Sourcepub async fn delete_by_key(
executor: &mut dyn Executor,
key: impl IntoExpr<FieldExprTarget<String>>,
) -> Result<()>
pub async fn delete_by_key( executor: &mut dyn Executor, key: impl IntoExpr<FieldExprTarget<String>>, ) -> Result<()>
Deletes the AuthThrottle where key matches.
Sourcepub fn filter_by_key(
key: impl IntoExpr<FieldExprTarget<String>>,
) -> AuthThrottleQuery
pub fn filter_by_key( key: impl IntoExpr<FieldExprTarget<String>>, ) -> AuthThrottleQuery
Returns a query selecting the AuthThrottle records where key matches.
Sourcepub async fn get_by_scope(
executor: &mut dyn Executor,
scope: impl IntoExpr<FieldExprTarget<String>>,
) -> Result<AuthThrottle>
pub async fn get_by_scope( executor: &mut dyn Executor, scope: impl IntoExpr<FieldExprTarget<String>>, ) -> Result<AuthThrottle>
Fetches the single AuthThrottle where scope matches, erroring if none exists.
Sourcepub fn update_by_scope(
scope: impl IntoExpr<FieldExprTarget<String>>,
) -> AuthThrottleUpdate
pub fn update_by_scope( scope: impl IntoExpr<FieldExprTarget<String>>, ) -> AuthThrottleUpdate
Returns a builder that updates the AuthThrottle where scope matches.
Sourcepub async fn delete_by_scope(
executor: &mut dyn Executor,
scope: impl IntoExpr<FieldExprTarget<String>>,
) -> Result<()>
pub async fn delete_by_scope( executor: &mut dyn Executor, scope: impl IntoExpr<FieldExprTarget<String>>, ) -> Result<()>
Deletes the AuthThrottle where scope matches.
Sourcepub fn filter_by_scope(
scope: impl IntoExpr<FieldExprTarget<String>>,
) -> AuthThrottleQuery
pub fn filter_by_scope( scope: impl IntoExpr<FieldExprTarget<String>>, ) -> AuthThrottleQuery
Returns a query selecting the AuthThrottle records where scope matches.
Sourcepub fn create() -> AuthThrottleCreate
pub fn create() -> AuthThrottleCreate
Returns a builder that inserts a new AuthThrottle record.
Typically constructed through the toasty::create! macro.
Sourcepub fn create_many() -> CreateMany<AuthThrottle>
pub fn create_many() -> CreateMany<AuthThrottle>
Returns a builder that inserts multiple AuthThrottle records at once.
Sourcepub fn update(&mut self) -> AuthThrottleUpdate<&mut Self>
pub fn update(&mut self) -> AuthThrottleUpdate<&mut Self>
Returns a builder that updates this AuthThrottle record in place.
Source§impl AuthThrottle
impl AuthThrottle
Sourcepub fn upsert_by_key(
key: impl IntoExpr<FieldExprTarget<String>>,
) -> AuthThrottleUpsertByKey
pub fn upsert_by_key( key: impl IntoExpr<FieldExprTarget<String>>, ) -> AuthThrottleUpsertByKey
Returns a builder that creates AuthThrottle or updates the record whose key constraint matches.
The target arguments initialize a new record and remain unchanged when an existing record is updated.
Trait Implementations§
Source§impl Assign<AuthThrottle> for AuthThrottle
impl Assign<AuthThrottle> for AuthThrottle
Source§fn into_assignment(self) -> Assignment<AuthThrottle>
fn into_assignment(self) -> Assignment<AuthThrottle>
Assignment<T> value.Source§fn assign(self, assignments: &mut Assignments, projection: Projection)where
Self: Sized,
fn assign(self, assignments: &mut Assignments, projection: Projection)where
Self: Sized,
Assignments] map at
the specified projection.Source§impl Clone for AuthThrottle
impl Clone for AuthThrottle
Source§impl Debug for AuthThrottle
impl Debug for AuthThrottle
Source§impl IntoExpr<AuthThrottle> for AuthThrottle
impl IntoExpr<AuthThrottle> for AuthThrottle
Source§impl IntoStatement for &AuthThrottle
impl IntoStatement for &AuthThrottle
Source§type Returning = AuthThrottle
type Returning = AuthThrottle
Source§fn into_statement(self) -> Statement<AuthThrottle>
fn into_statement(self) -> Statement<AuthThrottle>
self and produce the Statement.Source§impl IntoStatement for &mut AuthThrottle
impl IntoStatement for &mut AuthThrottle
Source§type Returning = AuthThrottle
type Returning = AuthThrottle
Source§fn into_statement(self) -> Statement<AuthThrottle>
fn into_statement(self) -> Statement<AuthThrottle>
self and produce the Statement.Source§impl IntoStatement for AuthThrottle
impl IntoStatement for AuthThrottle
Source§type Returning = AuthThrottle
type Returning = AuthThrottle
Source§fn into_statement(self) -> Statement<AuthThrottle>
fn into_statement(self) -> Statement<AuthThrottle>
self and produce the Statement.Source§impl Load for AuthThrottle
impl Load for AuthThrottle
Source§fn ty() -> Type
fn ty() -> Type
stmt::Type that describes values of this type.Source§fn reload(target: &mut Self, value: Value) -> Result<()>
fn reload(target: &mut Self, value: Value) -> Result<()>
Source§fn ty_relation() -> Type
fn ty_relation() -> Type
stmt::Type used when this type appears as a relation
target. The default delegates to ty().Source§impl Model for AuthThrottle
impl Model for AuthThrottle
Source§type Query<__T> = AuthThrottleQuery<__T>
type Query<__T> = AuthThrottleQuery<__T>
Source§type Update<'a> = AuthThrottleUpdate<&'a mut AuthThrottle>
type Update<'a> = AuthThrottleUpdate<&'a mut AuthThrottle>
Source§type UpdateQuery = AuthThrottleUpdate
type UpdateQuery = AuthThrottleUpdate
Source§type PrimaryKey = String
type PrimaryKey = String
Source§type ManyField<__Origin> = AuthThrottleListFields<__Origin>
type ManyField<__Origin> = AuthThrottleListFields<__Origin>
Source§type OneField<__Origin, __Target> = AuthThrottleFields<__Origin, __Target>
type OneField<__Origin, __Target> = AuthThrottleFields<__Origin, __Target>
Source§fn new_path<__Origin>(path: Path<__Origin, Self>) -> Self::Path<__Origin>
fn new_path<__Origin>(path: Path<__Origin, Self>) -> Self::Path<__Origin>
Path targeting this model.Source§fn new_many_field<__Origin>(
path: Path<__Origin, List<Self>>,
) -> AuthThrottleListFields<__Origin>
fn new_many_field<__Origin>( path: Path<__Origin, List<Self>>, ) -> AuthThrottleListFields<__Origin>
ManyField from a path targeting a list
of this model.Source§fn find_by_primary_key(id: Expr<Self::PrimaryKey>) -> Self::Query<List<Self>>
fn find_by_primary_key(id: Expr<Self::PrimaryKey>) -> Self::Query<List<Self>>
Source§fn wrap_query<__T>(stmt: Query<__T>) -> Self::Query<__T>
fn wrap_query<__T>(stmt: Query<__T>) -> Self::Query<__T>
Query in this model’s
query builder, preserving the result shape T. This is the single
constructor generic code uses to build any query shape; callers narrow
at the statement level (.one(), .first()) before wrapping.Source§fn query_one(query: Self::Query<List<Self>>) -> Self::Query<Self>
fn query_one(query: Self::Query<List<Self>>) -> Self::Query<Self>
Source§fn query_first(query: Self::Query<List<Self>>) -> Self::Query<Option<Self>>
fn query_first(query: Self::Query<List<Self>>) -> Self::Query<Option<Self>>
Source§fn new_root_path() -> Self::Path<Self>
fn new_root_path() -> Self::Path<Self>
Source§fn path_model_list() -> Path<List<Self>, List<Self>>
fn path_model_list() -> Path<List<Self>, List<Self>>
Path rooted at a list of this model, used as the root of
has-many relation scopes.Source§fn new_create() -> Self::Create
fn new_create() -> Self::Create
Source§impl ModelCodegen for AuthThrottle
impl ModelCodegen for AuthThrottle
Source§fn to_relation_expr(&self, fields: &[&str]) -> Expr
fn to_relation_expr(&self, fields: &[&str]) -> Expr
Source§fn new_one_field<__Origin, __Target>(
path: Path<__Origin, __Target>,
) -> Self::OneField<__Origin, __Target>
fn new_one_field<__Origin, __Target>( path: Path<__Origin, __Target>, ) -> Self::OneField<__Origin, __Target>
Source§impl UpdateTarget for &mut AuthThrottle
impl UpdateTarget for &mut AuthThrottle
Source§type Returning = AuthThrottle
type Returning = AuthThrottle
Update<R> statement.Source§fn to_update_stmt(&mut self, assignments: Assignments) -> Update<AuthThrottle>
fn to_update_stmt(&mut self, assignments: Assignments) -> Update<AuthThrottle>
Source§impl ViaTarget for AuthThrottle
impl ViaTarget for AuthThrottle
Source§type Query = AuthThrottleQuery
type Query = AuthThrottleQuery
Source§type Path<__Origin> = <AuthThrottle as Model>::ManyField<__Origin>
type Path<__Origin> = <AuthThrottle as Model>::ManyField<__Origin>
#[has_many(via = …)] field’s accessor returns,
parameterized by the origin model. Mirrors Model::Path for the
via-many case. Read moreSource§fn new_path<__Origin>(
path: Path<__Origin, List<AuthThrottle>>,
) -> Self::Path<__Origin>
fn new_path<__Origin>( path: Path<__Origin, List<AuthThrottle>>, ) -> Self::Path<__Origin>
Path handle from the typed path reaching this
terminal. A model terminal wraps the path in its chainable ManyField; a
scalar terminal is a leaf, so the path is the handle.Source§fn via_field_ty(singular: Name, path: Path) -> FieldTy
fn via_field_ty(singular: Name, path: Path) -> FieldTy
FieldTy::Via for a #[has_many(via = …)] field whose
terminal element type is Self. Read moreSource§fn make_via_query(assoc: Association<List<AuthThrottle>>) -> Self::Query
fn make_via_query(assoc: Association<List<AuthThrottle>>) -> Self::Query
Auto Trait Implementations§
impl Forget for AuthThrottle
impl Freeze for AuthThrottle
impl Move for AuthThrottle
impl RefUnwindSafe for AuthThrottle
impl Send for AuthThrottle
impl Sync for AuthThrottle
impl Unpin for AuthThrottle
impl UnsafeUnpin for AuthThrottle
impl UnwindSafe for AuthThrottle
Blanket Implementations§
Source§impl<T> Assign<Arc<T>> for Twhere
T: IntoExpr<T>,
impl<T> Assign<Arc<T>> for Twhere
T: IntoExpr<T>,
Source§fn into_assignment(self) -> Assignment<Arc<T>>
fn into_assignment(self) -> Assignment<Arc<T>>
Assignment<T> value.Source§fn assign(self, assignments: &mut Assignments, projection: Projection)where
Self: Sized,
fn assign(self, assignments: &mut Assignments, projection: Projection)where
Self: Sized,
Assignments] map at
the specified projection.Source§impl<T> Assign<Box<T>> for Twhere
T: IntoExpr<T>,
impl<T> Assign<Box<T>> for Twhere
T: IntoExpr<T>,
Source§fn into_assignment(self) -> Assignment<Box<T>>
fn into_assignment(self) -> Assignment<Box<T>>
Assignment<T> value.Source§fn assign(self, assignments: &mut Assignments, projection: Projection)where
Self: Sized,
fn assign(self, assignments: &mut Assignments, projection: Projection)where
Self: Sized,
Assignments] map at
the specified projection.Source§impl<T> Assign<Option<T>> for Twhere
T: IntoExpr<T>,
impl<T> Assign<Option<T>> for Twhere
T: IntoExpr<T>,
Source§fn into_assignment(self) -> Assignment<Option<T>>
fn into_assignment(self) -> Assignment<Option<T>>
Assignment<T> value.Source§fn assign(self, assignments: &mut Assignments, projection: Projection)where
Self: Sized,
fn assign(self, assignments: &mut Assignments, projection: Projection)where
Self: Sized,
Assignments] map at
the specified projection.Source§impl<T> Assign<Rc<T>> for Twhere
T: IntoExpr<T>,
impl<T> Assign<Rc<T>> for Twhere
T: IntoExpr<T>,
Source§fn into_assignment(self) -> Assignment<Rc<T>>
fn into_assignment(self) -> Assignment<Rc<T>>
Assignment<T> value.Source§fn assign(self, assignments: &mut Assignments, projection: Projection)where
Self: Sized,
fn assign(self, assignments: &mut Assignments, projection: Projection)where
Self: Sized,
Assignments] map at
the specified projection.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
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<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<M> RelationOneField for Mwhere
M: Model,
impl<M> RelationOneField for Mwhere
M: Model,
Source§type One = <M as Model>::Query<M>
type One = <M as Model>::Query<M>
<Target as Model>::Query<Target>; for nullable impls it is
<Target as Model>::Query<Option<Target>>.Source§type Expr = M
type Expr = M
Self::Target for non-nullable impls and
Option<Self::Target> for nullable impls.Source§fn make_one(
query: <<M as RelationOneField>::Target as Model>::Query<List<<M as RelationOneField>::Target>>,
) -> <M as RelationOneField>::One
fn make_one( query: <<M as RelationOneField>::Target as Model>::Query<List<<M as RelationOneField>::Target>>, ) -> <M as RelationOneField>::One
Query<Model> for non-nullable impls and
Query<Option<Model>> for nullable impls. Read moreSource§fn reload(target: &mut Self, value: Value) -> Result<(), Error>
fn reload(target: &mut Self, value: Value) -> Result<(), Error>
Source§fn belongs_to_relation_field_ty(foreign_key: ForeignKey) -> FieldTy
fn belongs_to_relation_field_ty(foreign_key: ForeignKey) -> FieldTy
FieldTy for a BelongsTo relation field, given the
foreign key resolved from the field’s #[belongs_to(...)] attribute.