#[non_exhaustive]pub enum TenancyFault {
Undeclared {
model: &'static str,
columns: Vec<&'static str>,
},
UndeclaredChild {
model: &'static str,
relation: String,
},
ColumnNotAField,
ViaOwnColumn,
ViaWithoutBelongsTo,
UnguardedForeignKey {
relation: String,
keys: Vec<String>,
},
}Expand description
Why a resource’s tenancy cannot scope its rows:
DeclarationErrorKind::Tenancy.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Undeclared
No tenancy declared over a model with a TenantId column, which would serve every
tenant’s rows.
Declare Tenancy::column over that field, or Tenancy::none() to serve every tenant.
UndeclaredChild
No tenancy declared over a model that belongs to one a mounted resource scopes by tenant, which would serve every tenant’s children.
Declare Tenancy::via through that relation, or Tenancy::none() to serve every tenant.
Fields
ColumnNotAField
A Tenancy::column lens that names no field of the model.
Name the model’s TenantId field, or use Tenancy::via.
ViaOwnColumn
A Tenancy::via lens that names one field of the model.
Use Tenancy::column.
ViaWithoutBelongsTo
A Tenancy::via lens whose first step is no belongs_to relation.
Start at the relation whose parent holds the tenant.
UnguardedForeignKey
A Tenancy::via resource whose form writes the parent’s foreign key other than through a
relationship field over a tenant-scoped resource of the parent’s model.
Write the key through such a choice, so the write re-checks its tenant.
Trait Implementations§
Source§impl Clone for TenancyFault
impl Clone for TenancyFault
Source§impl Debug for TenancyFault
impl Debug for TenancyFault
Source§impl Display for TenancyFault
impl Display for TenancyFault
impl Eq for TenancyFault
Source§impl PartialEq for TenancyFault
impl PartialEq for TenancyFault
impl StructuralPartialEq for TenancyFault
Auto Trait Implementations§
impl Freeze for TenancyFault
impl RefUnwindSafe for TenancyFault
impl Send for TenancyFault
impl Sync for TenancyFault
impl Unpin for TenancyFault
impl UnsafeUnpin for TenancyFault
impl UnwindSafe for TenancyFault
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
impl<T> CloneAny for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
key and return true if they are equal.