pub struct FeatureSchema {
pub version: u32,
pub features: Vec<FeatureDescriptor>,
}Expand description
Ordered feature schema with an explicit caller-owned version.
Fields§
§version: u32Non-zero schema version.
features: Vec<FeatureDescriptor>Ordered feature descriptors. Order is part of the hash.
Implementations§
Source§impl FeatureSchema
impl FeatureSchema
Sourcepub fn new(
version: u32,
features: Vec<FeatureDescriptor>,
) -> Result<Self, RillError>
pub fn new( version: u32, features: Vec<FeatureDescriptor>, ) -> Result<Self, RillError>
Construct and validate an ordered schema.
Sourcepub fn validate(&self) -> Result<(), RillError>
pub fn validate(&self) -> Result<(), RillError>
Validate version, capacity, descriptor, and unique-name invariants.
Sourcepub fn hash(&self) -> Result<FeatureSchemaHash, RillError>
pub fn hash(&self) -> Result<FeatureSchemaHash, RillError>
Compute a canonical SHA-256 digest without relying on JSON map order.
Trait Implementations§
Source§impl Clone for FeatureSchema
impl Clone for FeatureSchema
Source§fn clone(&self) -> FeatureSchema
fn clone(&self) -> FeatureSchema
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 FeatureSchema
impl Debug for FeatureSchema
Source§impl PartialEq for FeatureSchema
impl PartialEq for FeatureSchema
impl StructuralPartialEq for FeatureSchema
Auto Trait Implementations§
impl Freeze for FeatureSchema
impl RefUnwindSafe for FeatureSchema
impl Send for FeatureSchema
impl Sync for FeatureSchema
impl Unpin for FeatureSchema
impl UnsafeUnpin for FeatureSchema
impl UnwindSafe for FeatureSchema
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