pub struct GeneratedComponentSchema {
pub id: ComponentId,
pub name: &'static str,
pub storage: ComponentStorageKind,
pub sync: ComponentSyncMode,
pub migration: ComponentMigrationMode,
pub max_bytes: usize,
pub fields: &'static [ComponentFieldDescriptor],
}Expand description
Component schema shape emitted by an external generator.
Fields§
§id: ComponentIdComponent id used in hot-path records.
name: &'static strStable debug name.
storage: ComponentStorageKindStorage strategy.
sync: ComponentSyncModeSynchronization strategy.
migration: ComponentMigrationModeMigration strategy.
max_bytes: usizeMaximum accepted blob size in bytes.
fields: &'static [ComponentFieldDescriptor]Generated field layout.
Implementations§
Source§impl GeneratedComponentSchema
impl GeneratedComponentSchema
Sourcepub const fn new(
id: ComponentId,
name: &'static str,
storage: ComponentStorageKind,
sync: ComponentSyncMode,
migration: ComponentMigrationMode,
max_bytes: usize,
fields: &'static [ComponentFieldDescriptor],
) -> Self
pub const fn new( id: ComponentId, name: &'static str, storage: ComponentStorageKind, sync: ComponentSyncMode, migration: ComponentMigrationMode, max_bytes: usize, fields: &'static [ComponentFieldDescriptor], ) -> Self
Creates a generated component schema.
Sourcepub fn validate(&self) -> Result<(), ComponentSchemaError>
pub fn validate(&self) -> Result<(), ComponentSchemaError>
Validates generated layout invariants.
Sourcepub fn schema_hash(&self) -> u64
pub fn schema_hash(&self) -> u64
Returns the generated schema hash.
Sourcepub fn fixed_size(&self) -> Option<usize>
pub fn fixed_size(&self) -> Option<usize>
Returns the maximum generated fixed size.
Sourcepub fn descriptor(&self) -> ComponentDescriptor
pub fn descriptor(&self) -> ComponentDescriptor
Builds a component descriptor with the generated schema hash attached.
Sourcepub fn component_schema(&self) -> ComponentSchema
pub fn component_schema(&self) -> ComponentSchema
Builds a typed component schema wrapper.
Trait Implementations§
Source§impl Clone for GeneratedComponentSchema
impl Clone for GeneratedComponentSchema
Source§fn clone(&self) -> GeneratedComponentSchema
fn clone(&self) -> GeneratedComponentSchema
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 GeneratedComponentSchema
Source§impl Debug for GeneratedComponentSchema
impl Debug for GeneratedComponentSchema
impl Eq for GeneratedComponentSchema
Source§impl PartialEq for GeneratedComponentSchema
impl PartialEq for GeneratedComponentSchema
impl StructuralPartialEq for GeneratedComponentSchema
Auto Trait Implementations§
impl Freeze for GeneratedComponentSchema
impl RefUnwindSafe for GeneratedComponentSchema
impl Send for GeneratedComponentSchema
impl Sync for GeneratedComponentSchema
impl Unpin for GeneratedComponentSchema
impl UnsafeUnpin for GeneratedComponentSchema
impl UnwindSafe for GeneratedComponentSchema
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