pub struct TableSnapshot {
pub name: String,
pub model: String,
pub fields: Vec<FieldSnapshot>,
pub composite_fks: Vec<CompositeFkSnapshot>,
}Fields§
§name: String§model: String§fields: Vec<FieldSnapshot>§composite_fks: Vec<CompositeFkSnapshot>Composite (multi-column) FKs declared on the model via
#[rustango(fk_composite(...))]. Sub-slice F.5 of the
v0.15.0 ContentType plan. Skipped on serialize when empty
so older snapshots written before F.5 stay diff-clean
(matches the m2m_tables / indexes / checks
already-empty-elision pattern).
Implementations§
Source§impl TableSnapshot
impl TableSnapshot
Sourcepub fn from_schema(s: &ModelSchema) -> Self
pub fn from_schema(s: &ModelSchema) -> Self
Build a snapshot row from a registered ModelSchema. Public
so external callers (e.g. tenancy bootstrap migrations) can
assemble their own snapshots without going through the global
inventory.
Sourcepub fn field(&self, column: &str) -> Option<&FieldSnapshot>
pub fn field(&self, column: &str) -> Option<&FieldSnapshot>
Look up a field by SQL column name.
Sourcepub fn composite_fk(&self, name: &str) -> Option<&CompositeFkSnapshot>
pub fn composite_fk(&self, name: &str) -> Option<&CompositeFkSnapshot>
Look up a composite FK by constraint name.
Trait Implementations§
Source§impl Clone for TableSnapshot
impl Clone for TableSnapshot
Source§fn clone(&self) -> TableSnapshot
fn clone(&self) -> TableSnapshot
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TableSnapshot
impl Debug for TableSnapshot
Source§impl<'de> Deserialize<'de> for TableSnapshot
impl<'de> Deserialize<'de> for TableSnapshot
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for TableSnapshot
impl PartialEq for TableSnapshot
Source§fn eq(&self, other: &TableSnapshot) -> bool
fn eq(&self, other: &TableSnapshot) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for TableSnapshot
impl Serialize for TableSnapshot
impl StructuralPartialEq for TableSnapshot
Auto Trait Implementations§
impl Freeze for TableSnapshot
impl RefUnwindSafe for TableSnapshot
impl Send for TableSnapshot
impl Sync for TableSnapshot
impl Unpin for TableSnapshot
impl UnsafeUnpin for TableSnapshot
impl UnwindSafe for TableSnapshot
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> 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>
Converts
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>
Converts
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