pub struct SyncedTable { /* private fields */ }Expand description
A synced table’s key, audience, file references, shared triggers and who may change its rows directly (E2).
Implementations§
Source§impl SyncedTable
impl SyncedTable
Sourcepub fn identity(&self) -> &RowIdentity
pub fn identity(&self) -> &RowIdentity
The declared kind of row identity.
Sourcepub fn get_key_columns(&self) -> &[String]
pub fn get_key_columns(&self) -> &[String]
The declared primary-key columns, in order; defaults to id.
Sourcepub fn write_permission(&self) -> WritePermission
pub fn write_permission(&self) -> WritePermission
Who may change the table’s rows directly.
Sourcepub fn get_audience_column(&self) -> Option<&str>
pub fn get_audience_column(&self) -> Option<&str>
The root audience column, including when inheritance was also declared. Opening refuses a declaration with both audience sources.
Sourcepub fn get_audience_from(&self) -> Option<&str>
pub fn get_audience_from(&self) -> Option<&str>
The audience foreign key, including when a root column was also declared. Opening refuses a declaration with both audience sources.
Sourcepub fn file_columns(&self) -> &[FileColumn]
pub fn file_columns(&self) -> &[FileColumn]
The declared file reference columns, in declaration order.
The shared trigger names, in declaration order, including repetitions.
Sourcepub fn new(name: impl Into<String>, identity: RowIdentity) -> SyncedTable
pub fn new(name: impl Into<String>, identity: RowIdentity) -> SyncedTable
Declare a synced table with the one-column primary key id.
Sourcepub fn owner_only(self) -> SyncedTable
pub fn owner_only(self) -> SyncedTable
Only each row’s original creating member may directly update or delete it (§9.6). Shared-trigger targets count as direct writes; foreign-key actions from authorized changes may still reach the row. No app owner column is needed. Changing a table’s write permission is a breaking schema change (§18.1).
Sourcepub fn admin_only(self) -> SyncedTable
pub fn admin_only(self) -> SyncedTable
Only a member who is an admin as of the write’s slot may directly insert, update or delete its rows, whoever created them (§9.6). Shared-trigger targets count as direct writes; foreign-key actions from authorized changes may still reach the row. Changing a table’s write permission is a breaking schema change (§18.1).
Sourcepub fn key_columns<I, S>(self, columns: I) -> SyncedTable
pub fn key_columns<I, S>(self, columns: I) -> SyncedTable
The columns in PRIMARY KEY order.
Sourcepub fn audience_column(self, column: impl Into<String>) -> SyncedTable
pub fn audience_column(self, column: impl Into<String>) -> SyncedTable
Set the root’s non-null text audience column. Declaring inheritance too is an error.
Sourcepub fn audience_from(self, foreign_key: impl Into<String>) -> SyncedTable
pub fn audience_from(self, foreign_key: impl Into<String>) -> SyncedTable
Inherit the audience through this foreign key. Declaring a root column too is an error.
Sourcepub fn file_column(self, column: FileColumn) -> SyncedTable
pub fn file_column(self, column: FileColumn) -> SyncedTable
Declare a column holding a file reference. Opening and migrating check the column against this synced table’s actual schema.
Declare a trigger as shared; all other triggers are local.
Trait Implementations§
Source§impl Clone for SyncedTable
impl Clone for SyncedTable
Source§fn clone(&self) -> SyncedTable
fn clone(&self) -> SyncedTable
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 SyncedTable
impl Debug for SyncedTable
impl Eq for SyncedTable
Source§impl PartialEq for SyncedTable
impl PartialEq for SyncedTable
impl StructuralPartialEq for SyncedTable
Auto Trait Implementations§
impl Freeze for SyncedTable
impl RefUnwindSafe for SyncedTable
impl Send for SyncedTable
impl Sync for SyncedTable
impl Unpin for SyncedTable
impl UnsafeUnpin for SyncedTable
impl UnwindSafe for SyncedTable
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more