pub struct SchemaRegistry { /* private fields */ }Expand description
Registry for command output schemas.
Implementations§
Source§impl SchemaRegistry
impl SchemaRegistry
Sourcepub fn register<T: OutputSchema>(&mut self, command_path: impl Into<String>)
pub fn register<T: OutputSchema>(&mut self, command_path: impl Into<String>)
Registers a manual schema for a command path.
Sourcepub fn register_json_schema<T: JsonSchema>(
&mut self,
command_path: impl Into<String>,
)
pub fn register_json_schema<T: JsonSchema>( &mut self, command_path: impl Into<String>, )
Registers a schemars JSON Schema for a command path.
Sourcepub fn register_fields(
&mut self,
command_path: impl Into<String>,
fields: impl Into<Vec<FieldInfo>>,
)
pub fn register_fields( &mut self, command_path: impl Into<String>, fields: impl Into<Vec<FieldInfo>>, )
Registers compact field summaries for a command path.
Sourcepub fn register_info(
&mut self,
command_path: impl Into<String>,
info: SchemaInfo,
)
pub fn register_info( &mut self, command_path: impl Into<String>, info: SchemaInfo, )
Registers a complete schema record for a command path.
Sourcepub fn get_by_path(&self, command_path: &str) -> Option<SchemaInfo>
pub fn get_by_path(&self, command_path: &str) -> Option<SchemaInfo>
Looks up schema information by colon-separated or space-separated path.
Trait Implementations§
Source§impl Clone for SchemaRegistry
impl Clone for SchemaRegistry
Source§fn clone(&self) -> SchemaRegistry
fn clone(&self) -> SchemaRegistry
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 SchemaRegistry
impl Debug for SchemaRegistry
Source§impl Default for SchemaRegistry
impl Default for SchemaRegistry
Source§fn default() -> SchemaRegistry
fn default() -> SchemaRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SchemaRegistry
impl RefUnwindSafe for SchemaRegistry
impl Send for SchemaRegistry
impl Sync for SchemaRegistry
impl Unpin for SchemaRegistry
impl UnsafeUnpin for SchemaRegistry
impl UnwindSafe for SchemaRegistry
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