pub struct Schema {
pub app: Schema,
pub db: Schema,
pub mapping: Mapping,
}Expand description
The combined schema: app-level models, database-level tables, and the mapping that connects them.
Constructed with Builder and validated on creation. Immutable at runtime.
§Examples
ⓘ
use toasty_core::Schema;
fn inspect(schema: &Schema) {
for (id, model) in &schema.app.models {
let table = schema.table_for(*id);
println!("{} -> {}", model.name().snake_case(), table.name);
}
}Fields§
§app: SchemaApplication-level schema.
db: SchemaDatabase-level schema.
mapping: MappingMaps the app-level schema to the db-level schema.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Schema
impl RefUnwindSafe for Schema
impl Send for Schema
impl Sync for Schema
impl Unpin for Schema
impl UnwindSafe for Schema
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