pub struct MetadataSchema { /* private fields */ }Expand description
Metadata schema for core keys and plugin extension keys.
Implementations§
Source§impl MetadataSchema
impl MetadataSchema
Sourcepub fn register_plugin_key(
&mut self,
key: &str,
kind: MetadataKind,
) -> Result<()>
pub fn register_plugin_key( &mut self, key: &str, kind: MetadataKind, ) -> Result<()>
Registers a plugin metadata key in publisher/plugin:key format.
Sourcepub fn contains_key(&self, key: &str) -> bool
pub fn contains_key(&self, key: &str) -> bool
Returns true when key is registered in schema.
Sourcepub fn kind(&self, key: &str) -> Option<MetadataKind>
pub fn kind(&self, key: &str) -> Option<MetadataKind>
Returns declared metadata kind for registered key.
Sourcepub fn is_core_key(&self, key: &str) -> bool
pub fn is_core_key(&self, key: &str) -> bool
Returns true when key is one of built-in core:* keys.
Sourcepub fn validate_value(&self, key: &str, value: &MetadataValue) -> Result<()>
pub fn validate_value(&self, key: &str, value: &MetadataValue) -> Result<()>
Validates that key is registered and value matches declared kind.
Trait Implementations§
Source§impl Clone for MetadataSchema
impl Clone for MetadataSchema
Source§fn clone(&self) -> MetadataSchema
fn clone(&self) -> MetadataSchema
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 MetadataSchema
impl Debug for MetadataSchema
Source§impl PartialEq for MetadataSchema
impl PartialEq for MetadataSchema
Source§fn eq(&self, other: &MetadataSchema) -> bool
fn eq(&self, other: &MetadataSchema) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for MetadataSchema
impl StructuralPartialEq for MetadataSchema
Auto Trait Implementations§
impl Freeze for MetadataSchema
impl RefUnwindSafe for MetadataSchema
impl Send for MetadataSchema
impl Sync for MetadataSchema
impl Unpin for MetadataSchema
impl UnsafeUnpin for MetadataSchema
impl UnwindSafe for MetadataSchema
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