pub struct ColumnPreference {
pub key: String,
pub user_id: String,
pub panel: String,
pub resource: String,
pub columns: String,
}Expand description
Shipped record of the toggleable columns one user shows or hides in one resource’s list, on one panel.
The panel writes a row when the user applies a choice that departs from the columns’ defaults,
and deletes it when the user resets to them. Register it with the app’s models when a table
declares a toggleable or
hidden_by_default column and auth is on.
Fields§
§key: StringThe panel, the user and the resource, query-encoded: one row per user per list.
user_id: StringPanelUser::user_id of the user who chose; indexed so
erase_user deletes their rows, which the panel leaves behind.
panel: StringThe prefix of the panel the list is on (e.g. /admin).
resource: StringThe slug of the resource whose list it is.
columns: StringThe columns the user hides or shows against their defaults, query-encoded. Text, since a
few names outgrow the VARCHAR(191) MySQL gives a String.
Implementations§
Source§impl ColumnPreference
impl ColumnPreference
Sourcepub fn fields() -> ColumnPreferenceFields<ColumnPreference>
pub fn fields() -> ColumnPreferenceFields<ColumnPreference>
Returns a handle used to reference ColumnPreference’s fields when building query expressions.
Sourcepub async fn get_by_key(
executor: &mut dyn Executor,
key: impl IntoExpr<<String as Field>::ExprTarget>,
) -> Result<ColumnPreference, Error>
pub async fn get_by_key( executor: &mut dyn Executor, key: impl IntoExpr<<String as Field>::ExprTarget>, ) -> Result<ColumnPreference, Error>
Fetches the single ColumnPreference where key matches, erroring if none exists.
Sourcepub fn update_by_key(
key: impl IntoExpr<<String as Field>::ExprTarget>,
) -> ColumnPreferenceUpdate
pub fn update_by_key( key: impl IntoExpr<<String as Field>::ExprTarget>, ) -> ColumnPreferenceUpdate
Returns a builder that updates the ColumnPreference where key matches.
Sourcepub async fn delete_by_key(
executor: &mut dyn Executor,
key: impl IntoExpr<<String as Field>::ExprTarget>,
) -> Result<(), Error>
pub async fn delete_by_key( executor: &mut dyn Executor, key: impl IntoExpr<<String as Field>::ExprTarget>, ) -> Result<(), Error>
Deletes the ColumnPreference where key matches.
Sourcepub fn filter_by_key(
key: impl IntoExpr<<String as Field>::ExprTarget>,
) -> ColumnPreferenceQuery
pub fn filter_by_key( key: impl IntoExpr<<String as Field>::ExprTarget>, ) -> ColumnPreferenceQuery
Returns a query selecting the ColumnPreference records where key matches.
Sourcepub async fn get_by_user_id(
executor: &mut dyn Executor,
user_id: impl IntoExpr<<String as Field>::ExprTarget>,
) -> Result<ColumnPreference, Error>
pub async fn get_by_user_id( executor: &mut dyn Executor, user_id: impl IntoExpr<<String as Field>::ExprTarget>, ) -> Result<ColumnPreference, Error>
Fetches the single ColumnPreference where user_id matches, erroring if none exists.
Sourcepub fn update_by_user_id(
user_id: impl IntoExpr<<String as Field>::ExprTarget>,
) -> ColumnPreferenceUpdate
pub fn update_by_user_id( user_id: impl IntoExpr<<String as Field>::ExprTarget>, ) -> ColumnPreferenceUpdate
Returns a builder that updates the ColumnPreference where user_id matches.
Sourcepub async fn delete_by_user_id(
executor: &mut dyn Executor,
user_id: impl IntoExpr<<String as Field>::ExprTarget>,
) -> Result<(), Error>
pub async fn delete_by_user_id( executor: &mut dyn Executor, user_id: impl IntoExpr<<String as Field>::ExprTarget>, ) -> Result<(), Error>
Deletes the ColumnPreference where user_id matches.
Sourcepub fn filter_by_user_id(
user_id: impl IntoExpr<<String as Field>::ExprTarget>,
) -> ColumnPreferenceQuery
pub fn filter_by_user_id( user_id: impl IntoExpr<<String as Field>::ExprTarget>, ) -> ColumnPreferenceQuery
Returns a query selecting the ColumnPreference records where user_id matches.
Sourcepub fn create() -> ColumnPreferenceCreate
pub fn create() -> ColumnPreferenceCreate
Returns a builder that inserts a new ColumnPreference record.
Typically constructed through the toasty::create! macro.
Sourcepub fn create_many() -> CreateMany<ColumnPreference>
pub fn create_many() -> CreateMany<ColumnPreference>
Returns a builder that inserts multiple ColumnPreference records at once.
Sourcepub fn update(&mut self) -> ColumnPreferenceUpdate<&mut ColumnPreference>
pub fn update(&mut self) -> ColumnPreferenceUpdate<&mut ColumnPreference>
Returns a builder that updates this ColumnPreference record in place.
Sourcepub fn all() -> ColumnPreferenceQuery
pub fn all() -> ColumnPreferenceQuery
Returns a query that selects every ColumnPreference record.
Source§impl ColumnPreference
impl ColumnPreference
Sourcepub fn upsert_by_key(
key: impl IntoExpr<<String as Field>::ExprTarget>,
) -> ColumnPreferenceUpsertByKey
pub fn upsert_by_key( key: impl IntoExpr<<String as Field>::ExprTarget>, ) -> ColumnPreferenceUpsertByKey
Returns a builder that creates ColumnPreference 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<ColumnPreference> for ColumnPreference
impl Assign<ColumnPreference> for ColumnPreference
Source§fn into_assignment(self) -> Assignment<ColumnPreference>
fn into_assignment(self) -> Assignment<ColumnPreference>
Assignment<T>] value.Source§impl Clone for ColumnPreference
impl Clone for ColumnPreference
Source§fn clone(&self) -> ColumnPreference
fn clone(&self) -> ColumnPreference
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ColumnPreference
impl Debug for ColumnPreference
Source§impl IntoExpr<ColumnPreference> for ColumnPreference
impl IntoExpr<ColumnPreference> for ColumnPreference
Source§fn into_expr(self) -> Expr<ColumnPreference>
fn into_expr(self) -> Expr<ColumnPreference>
Source§fn by_ref(&self) -> Expr<ColumnPreference>
fn by_ref(&self) -> Expr<ColumnPreference>
Source§impl IntoStatement for &ColumnPreference
impl IntoStatement for &ColumnPreference
Source§type Returning = ColumnPreference
type Returning = ColumnPreference
Source§fn into_statement(self) -> Statement<ColumnPreference>
fn into_statement(self) -> Statement<ColumnPreference>
self and produce the [Statement].Source§impl IntoStatement for &mut ColumnPreference
impl IntoStatement for &mut ColumnPreference
Source§type Returning = ColumnPreference
type Returning = ColumnPreference
Source§fn into_statement(self) -> Statement<ColumnPreference>
fn into_statement(self) -> Statement<ColumnPreference>
self and produce the [Statement].Source§impl IntoStatement for ColumnPreference
impl IntoStatement for ColumnPreference
Source§type Returning = ColumnPreference
type Returning = ColumnPreference
Source§fn into_statement(self) -> Statement<ColumnPreference>
fn into_statement(self) -> Statement<ColumnPreference>
self and produce the [Statement].Source§impl Load for ColumnPreference
impl Load for ColumnPreference
Source§fn load(value: Value) -> Result<ColumnPreference, Error>
fn load(value: Value) -> Result<ColumnPreference, Error>
Source§fn reload(target: &mut ColumnPreference, value: Value) -> Result<(), Error>
fn reload(target: &mut ColumnPreference, value: Value) -> Result<(), Error>
§fn ty_relation() -> Type
fn ty_relation() -> Type
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>
Source§impl Model for ColumnPreference
impl Model for ColumnPreference
Source§type Query<__T> = ColumnPreferenceQuery<__T>
type Query<__T> = ColumnPreferenceQuery<__T>
Source§type Update<'a> = ColumnPreferenceUpdate<&'a mut ColumnPreference>
type Update<'a> = ColumnPreferenceUpdate<&'a mut ColumnPreference>
Source§type UpdateQuery = ColumnPreferenceUpdate
type UpdateQuery = ColumnPreferenceUpdate
Source§type Path<__Origin> = ColumnPreferenceFields<__Origin>
type Path<__Origin> = ColumnPreferenceFields<__Origin>
Origin into this model.Source§type PrimaryKey = String
type PrimaryKey = String
Source§type ManyField<__Origin> = ColumnPreferenceListFields<__Origin>
type ManyField<__Origin> = ColumnPreferenceListFields<__Origin>
Source§type OneField<__Origin, __Target> = ColumnPreferenceFields<__Origin, __Target>
type OneField<__Origin, __Target> = ColumnPreferenceFields<__Origin, __Target>
Source§fn register(model_set: &mut ModelSet)
fn register(model_set: &mut ModelSet)
ModelSet]. Read moreSource§fn new_path<__Origin>(
path: Path<__Origin, ColumnPreference>,
) -> <ColumnPreference as Model>::Path<__Origin>
fn new_path<__Origin>( path: Path<__Origin, ColumnPreference>, ) -> <ColumnPreference as Model>::Path<__Origin>
Path] targeting this model.Source§fn new_many_field<__Origin>(
path: Path<__Origin, List<ColumnPreference>>,
) -> ColumnPreferenceListFields<__Origin>
fn new_many_field<__Origin>( path: Path<__Origin, List<ColumnPreference>>, ) -> ColumnPreferenceListFields<__Origin>
ManyField from a path targeting a list
of this model.Source§fn find_by_primary_key(
id: Expr<<ColumnPreference as Model>::PrimaryKey>,
) -> <ColumnPreference as Model>::Query<List<ColumnPreference>>
fn find_by_primary_key( id: Expr<<ColumnPreference as Model>::PrimaryKey>, ) -> <ColumnPreference as Model>::Query<List<ColumnPreference>>
Source§fn wrap_query<__T>(stmt: Query<__T>) -> <ColumnPreference as Model>::Query<__T>
fn wrap_query<__T>(stmt: Query<__T>) -> <ColumnPreference as Model>::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: <ColumnPreference as Model>::Query<List<ColumnPreference>>,
) -> <ColumnPreference as Model>::Query<ColumnPreference>
fn query_one( query: <ColumnPreference as Model>::Query<List<ColumnPreference>>, ) -> <ColumnPreference as Model>::Query<ColumnPreference>
Source§fn query_first(
query: <ColumnPreference as Model>::Query<List<ColumnPreference>>,
) -> <ColumnPreference as Model>::Query<Option<ColumnPreference>>
fn query_first( query: <ColumnPreference as Model>::Query<List<ColumnPreference>>, ) -> <ColumnPreference as Model>::Query<Option<ColumnPreference>>
Source§fn field_name_to_id(name: &str) -> FieldId
fn field_name_to_id(name: &str) -> FieldId
FieldId]. Read more§fn new_root_path() -> Self::Path<Self>
fn new_root_path() -> Self::Path<Self>
§fn path_field<U>(index: usize) -> Path<Self, U>
fn path_field<U>(index: usize) -> Path<Self, U>
Path] from this model to the field at index.§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.§fn new_create() -> Self::Create
fn new_create() -> Self::Create
Source§impl UpdateTarget for &mut ColumnPreference
impl UpdateTarget for &mut ColumnPreference
Source§type Returning = ColumnPreference
type Returning = ColumnPreference
Update<R> statement.Source§fn to_update_stmt(
&mut self,
assignments: Assignments,
) -> Update<ColumnPreference>
fn to_update_stmt( &mut self, assignments: Assignments, ) -> Update<ColumnPreference>
Source§impl ViaTarget for ColumnPreference
impl ViaTarget for ColumnPreference
Source§type Query = ColumnPreferenceQuery
type Query = ColumnPreferenceQuery
Source§type Path<__Origin> = <ColumnPreference as Model>::ManyField<__Origin>
type Path<__Origin> = <ColumnPreference 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<ColumnPreference>>,
) -> <ColumnPreference as ViaTarget>::Path<__Origin>
fn new_path<__Origin>( path: Path<__Origin, List<ColumnPreference>>, ) -> <ColumnPreference as ViaTarget>::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<ColumnPreference>>,
) -> <ColumnPreference as ViaTarget>::Query
fn make_via_query( assoc: Association<List<ColumnPreference>>, ) -> <ColumnPreference as ViaTarget>::Query
Auto Trait Implementations§
impl Freeze for ColumnPreference
impl RefUnwindSafe for ColumnPreference
impl Send for ColumnPreference
impl Sync for ColumnPreference
impl Unpin for ColumnPreference
impl UnsafeUnpin for ColumnPreference
impl UnwindSafe for ColumnPreference
Blanket Implementations§
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<M> RelationOneField for Mwhere
M: Model,
impl<M> RelationOneField for Mwhere
M: Model,
§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>>.§type Expr = M
type Expr = M
Self::Target for non-nullable impls and
Option<Self::Target> for nullable impls.§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 more§fn reload(target: &mut Self, value: Value) -> Result<(), Error>
fn reload(target: &mut Self, value: Value) -> Result<(), Error>
§fn has_one_relation_field_ty(
pair: Option<FieldId>,
via: Option<Path>,
) -> FieldTy
fn has_one_relation_field_ty( pair: Option<FieldId>, via: Option<Path>, ) -> FieldTy
FieldTy] for a HasOne relation field, given an
optional paired BelongsTo field on the target model resolved
from #[has_one(pair = <field>)]. When None, the linker selects
the pair by searching the target for a unique BelongsTo back to
the source. Read more§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.