pub enum Schema {
Show 16 variants
Nullable(Box<Schema>),
Boolean,
I32,
I64,
U32,
U64,
F32,
F64,
Bytes,
String,
StaticArray(SchemaStaticArray),
DynamicArray(SchemaDynamicArray),
Map(SchemaMap),
AssetRef(SchemaFingerprint),
Record(SchemaFingerprint),
Enum(SchemaFingerprint),
}
Expand description
Describes format of data, either a single primitive value or complex layout comprised of potentially many values
Variants§
Nullable(Box<Schema>)
Marks the field as possible to be null
Boolean
I32
I64
U32
U64
F32
F64
Bytes
Variable amount of bytes stored within the asset
String
Variable-length UTF-8 String
StaticArray(SchemaStaticArray)
Fixed-size array of values
DynamicArray(SchemaDynamicArray)
Map(SchemaMap)
AssetRef(SchemaFingerprint)
Record(SchemaFingerprint)
Named type, it could be an enum, record, etc.
Enum(SchemaFingerprint)
Implementations§
Source§impl Schema
impl Schema
pub fn is_nullable(&self) -> bool
pub fn is_boolean(&self) -> bool
pub fn is_i32(&self) -> bool
pub fn is_i64(&self) -> bool
pub fn is_u32(&self) -> bool
pub fn is_u64(&self) -> bool
pub fn is_f32(&self) -> bool
pub fn is_f64(&self) -> bool
pub fn is_bytes(&self) -> bool
pub fn is_string(&self) -> bool
pub fn is_static_array(&self) -> bool
pub fn is_dynamic_array(&self) -> bool
pub fn is_map(&self) -> bool
pub fn is_asset_ref(&self) -> bool
pub fn is_record(&self) -> bool
pub fn is_enum(&self) -> bool
pub fn is_number(&self) -> bool
pub fn types_are_interchangeable( old_parent_schema: &Schema, new_parent_schema: &Schema, old_named_types: &HashMap<SchemaFingerprint, SchemaNamedType, RandomState>, new_named_types: &HashMap<SchemaFingerprint, SchemaNamedType, RandomState>, ) -> bool
pub fn find_post_migration_field_name<'a>( old_parent_schema: &Schema, old_property_name: &'a str, old_named_types: &HashMap<SchemaFingerprint, SchemaNamedType, RandomState>, _new_parent_schema: &Schema, new_named_types: &HashMap<SchemaFingerprint, SchemaNamedType, RandomState>, new_named_types_by_uuid: &HashMap<Uuid, SchemaFingerprint, RandomState>, ) -> Option<String>
pub fn find_field_schema<'a>( &'a self, name: impl AsRef<str>, named_types: &'a HashMap<SchemaFingerprint, SchemaNamedType, RandomState>, ) -> Option<&'a Schema>
pub fn find_referenced_schemas<'a>( named_types: &'a HashMap<SchemaFingerprint, SchemaNamedType, RandomState>, schema: &'a Schema, referenced_schema_fingerprints: &mut HashSet<SchemaFingerprint, RandomState>, visit_stack: &mut Vec<&'a Schema>, )
Trait Implementations§
impl StructuralPartialEq for Schema
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