pub struct TenantId(/* private fields */);Expand description
One tenant’s id, and the field type of a resource’s tenant column.
A model declares its tenant column with this type:
#[derive(Debug, Clone, toasty::Model)]
pub struct Note {
#[key]
#[auto]
id: uuid::Uuid,
#[index]
tenant_id: TenantId,
body: String,
}Tenancy::column and
Tenancy::via accept only a TenantColumn, so a lens naming any
other Uuid column — an author, a parent row, the key — does not compile. The column stores a
UUID, so the database column is unchanged.
Implementations§
Trait Implementations§
Source§impl Assign<TenantId> for TenantId
impl Assign<TenantId> for TenantId
Source§fn into_assignment(self) -> Assignment<TenantId>
fn into_assignment(self) -> Assignment<TenantId>
Convert into an
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,
Record one or more assignments into the given [
Assignments] map at
the specified projection.impl Copy for TenantId
impl Eq for TenantId
Source§impl Field for TenantId
impl Field for TenantId
Source§type ExprTarget = TenantId
type ExprTarget = TenantId
The expression-level type of this field. Read more
Source§type Path<Origin> = Path<Origin, TenantId>
type Path<Origin> = Path<Origin, TenantId>
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> = Path<Origin, List<<TenantId as Field>::ExprTarget>>
type ListPath<Origin> = Path<Origin, List<<TenantId as Field>::ExprTarget>>
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 = TenantId
type Inner = TenantId
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, Self>) -> Self::Path<Origin>
fn new_path<Origin>(path: Path<Origin, Self>) -> Self::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<Self::ExprTarget>>,
) -> Self::ListPath<Origin>
fn new_list_path<Origin>( path: Path<Origin, List<Self::ExprTarget>>, ) -> Self::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,
) -> Self::Update<'a>
fn new_update<'a>( _assignments: &'a mut Assignments, _projection: Projection, ) -> Self::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 key_constraint<Origin>(
&self,
target: Path<Origin, Self::Inner>,
) -> Expr<bool>
fn key_constraint<Origin>( &self, target: Path<Origin, Self::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
impl IndexableField for TenantId
Source§impl Load for TenantId
impl Load for TenantId
Source§fn ty() -> Type
fn ty() -> Type
Returns the
stmt::Type that describes values of this type.Source§fn reload(target: &mut Self::Output, value: Value) -> Result<(), Error>
fn reload(target: &mut Self::Output, value: Value) -> Result<(), Error>
Reload the value in-place from a value returned by the database. Read more
Source§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().Source§impl Ord for TenantId
impl Ord for TenantId
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for TenantId
impl PartialOrd for TenantId
impl StructuralPartialEq for TenantId
Source§impl TenantColumn for TenantId
impl TenantColumn for TenantId
Source§fn from_tenant(id: Uuid) -> Self
fn from_tenant(id: Uuid) -> Self
The column’s value for the request tenant
id.Source§impl TypedValue for TenantId
impl TypedValue for TenantId
Source§const INPUT_TYPE: &'static str = "text"
const INPUT_TYPE: &'static str = "text"
The
type attribute of the text control that edits it.Source§fn parse_input(value: &str) -> Option<Self>
fn parse_input(value: &str) -> Option<Self>
Reads a trimmed, non-empty submission, or
None when the type refuses it.Auto Trait Implementations§
impl Freeze for TenantId
impl RefUnwindSafe for TenantId
impl Send for TenantId
impl Sync for TenantId
impl Unpin for TenantId
impl UnsafeUnpin for TenantId
impl UnwindSafe for TenantId
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>>
Convert into an
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,
Record one or more assignments into the given [
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>>
Convert into an
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,
Record one or more assignments into the given [
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>>
Convert into an
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,
Record one or more assignments into the given [
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>>
Convert into an
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,
Record one or more assignments into the given [
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
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
impl<T> CloneAny for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.impl<K> ForeignKey<K> for K
Source§impl<T> FormScalar for Twhere
T: TypedValue,
impl<T> FormScalar for Twhere
T: TypedValue,
Source§const INPUT_TYPE: &'static str = const INPUT_TYPE: &'static str = T::INPUT_TYPE;
const INPUT_TYPE: &'static str = const INPUT_TYPE: &'static str = T::INPUT_TYPE;
The
type attribute of the text control that edits it.