pub struct SyncedTable { /* private fields */ }Expand description
A synced table’s key, audience, file references, shared triggers and whether only each row’s original creator writes it 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 is_owner_only(&self) -> bool
pub fn is_owner_only(&self) -> bool
Whether direct writes are restricted to each row’s original creator.
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 this declaration for an existing table 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 · 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
Source§impl PartialEq for SyncedTable
impl PartialEq for SyncedTable
impl Eq 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
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> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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