pub struct SchemaContext { /* private fields */ }Expand description
Schema context for semantic validation.
Applications can use this to register expected types for properties and validate that values match those types. This is advisory—the protocol does not enforce global type consistency.
Implementations§
Source§impl SchemaContext
impl SchemaContext
Sourcepub fn add_property(&mut self, id: Id, data_type: DataType)
pub fn add_property(&mut self, id: Id, data_type: DataType)
Registers a property with its expected data type.
Sourcepub fn get_property_type(&self, id: &Id) -> Option<DataType>
pub fn get_property_type(&self, id: &Id) -> Option<DataType>
Gets the expected data type for a property, if registered.
Trait Implementations§
Source§impl Clone for SchemaContext
impl Clone for SchemaContext
Source§fn clone(&self) -> SchemaContext
fn clone(&self) -> SchemaContext
Returns a duplicate of the value. Read more
1.0.0 · 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 SchemaContext
impl Debug for SchemaContext
Source§impl Default for SchemaContext
impl Default for SchemaContext
Source§fn default() -> SchemaContext
fn default() -> SchemaContext
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SchemaContext
impl RefUnwindSafe for SchemaContext
impl Send for SchemaContext
impl Sync for SchemaContext
impl Unpin for SchemaContext
impl UnwindSafe for SchemaContext
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