pub struct EmbeddedSchema {
pub version: u32,
pub compressed: &'static [u8],
}Expand description
Compile-time embedded schema snapshot (spec §8.4, decision 21c).
#[database] reads every committed snapshot file
(migrations/schema/{db}.{version}.json), compresses it with
miniz_oxide and embeds it into the binary. The full set is exposed via
DatabaseSpec::EMBEDDED_SCHEMAS in ascending version order.
Fields§
§version: u32Schema version of this snapshot.
compressed: &'static [u8]Compressed snapshot JSON (raw deflate — see
roomrs_migrate::compress_snapshot).
Implementations§
Source§impl EmbeddedSchema
impl EmbeddedSchema
Sourcepub fn snapshot(&self) -> Result<SchemaSnapshot>
pub fn snapshot(&self) -> Result<SchemaSnapshot>
Decompress and parse the embedded snapshot.
Fails with Error::Migration when the embedded blob is corrupt.
Trait Implementations§
Source§impl Clone for EmbeddedSchema
impl Clone for EmbeddedSchema
Source§fn clone(&self) -> EmbeddedSchema
fn clone(&self) -> EmbeddedSchema
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 moreimpl Copy for EmbeddedSchema
Auto Trait Implementations§
impl Freeze for EmbeddedSchema
impl RefUnwindSafe for EmbeddedSchema
impl Send for EmbeddedSchema
impl Sync for EmbeddedSchema
impl Unpin for EmbeddedSchema
impl UnsafeUnpin for EmbeddedSchema
impl UnwindSafe for EmbeddedSchema
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