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, tablo_core::ModelColumns)]
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: TenantId) -> Self
fn from_tenant(id: TenantId) -> Self
The column’s value for the request tenant
id.Source§impl TypedValue for TenantId
impl TypedValue for TenantId
Source§const NOUN: &'static str = "tablo-type-identifier"
const NOUN: &'static str = "tablo-type-identifier"
The message naming this type in a validation error, such as
tablo-type-date. An id no
catalog holds reads as written, so "color" names the type in every locale.Source§const INPUT_TYPE: &'static str = "text"
const INPUT_TYPE: &'static str = "text"
The
type attribute of the text control that edits it.Source§const STEP: Option<&'static str> = None
const STEP: Option<&'static str> = None
The control’s
step attribute, when its input type takes one.Source§const SORTABLE: bool = true
const SORTABLE: bool = true
Whether a database
ORDER BY over the stored column orders values as the type does, on
every driver. The ModelColumns derive makes a column of
the type sortable only when it does. false for the
decimal types, which some drivers store as text and so sort by spelling: 10.00, 100,
9.50.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.Source§fn input_value(stored: &str, zone: &TimeZone) -> String
fn input_value(stored: &str, zone: &TimeZone) -> String
The control’s
value for a stored value’s form spelling, shown in the request’s time zone
zone: the spelling itself by default.Source§fn form_value(posted: &str, zone: &TimeZone) -> String
fn form_value(posted: &str, zone: &TimeZone) -> String
The form spelling of what the control posted, read in the request’s time zone
zone: the
posted text itself by default. A type whose control posts a wall-clock time, as a
timestamp’s does, reads it here, so every later step parses one spelling.Source§fn form_spelling(&self) -> String
fn form_spelling(&self) -> String
The form spelling of a stored value, which
parse_input reads back:
its Display by default.Auto Trait Implementations§
impl Forget for TenantId
impl Freeze for TenantId
impl Move 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
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<T> ErasedDestructor for Twhere
T: 'static,
impl<T> FilterKey for T
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.Source§const STEP: Option<&'static str> = const STEP: Option<&'static str> = T::STEP;
const STEP: Option<&'static str> = const STEP: Option<&'static str> = T::STEP;
The control’s
step attribute, when its input type takes one.Source§const SORTABLE: bool = const SORTABLE: bool = T::SORTABLE;
const SORTABLE: bool = const SORTABLE: bool = T::SORTABLE;
Whether the database orders the stored column as the values order: a
TypedValue’s
SORTABLE, and true for any other type.Source§fn input_value(stored: &str, zone: &TimeZone) -> String
fn input_value(stored: &str, zone: &TimeZone) -> String
The control’s
value for a stored value’s form spelling, shown in the request’s time zone
zone: a TypedValue’s input_value, and the spelling
itself for any other type.Source§fn form_value(posted: &str, zone: &TimeZone) -> String
fn form_value(posted: &str, zone: &TimeZone) -> String
The form spelling of what the control posted, read in the request’s time zone
zone: a
TypedValue’s form_value, and the posted text itself for
any other type.Source§fn parse_form(value: &str) -> Result<T, Text>
fn parse_form(value: &str) -> Result<T, Text>
Parse a trimmed, non-empty submission, or return the error message.
Source§fn to_form(&self) -> String
fn to_form(&self) -> String
The form spelling of a stored value: a
TypedValue’s
form_spelling.Source§fn order(&self, other: &T) -> Option<Ordering>
fn order(&self, other: &T) -> Option<Ordering>
How
self orders against other for a text field’s min and
max: a TypedValue’s order, and
None for any other type.Source§fn to_label(&self) -> Text
fn to_label(&self) -> Text
What a column cell and a group header read: the form spelling, or an
Options enum’s label.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> ⓘ
Source§impl<T> IntoFormValue for Twhere
T: FormScalar,
impl<T> IntoFormValue for Twhere
T: FormScalar,
Source§fn into_form_value(self) -> FormValue
fn into_form_value(self) -> FormValue
The value as its control posts it.