pub struct MetadataSchema { /* private fields */ }Expand description
Schema for metadata fields.
A schema declares valid keys, their concrete DataType, and whether they
are required. It can validate actual Metadata values and validate that a
crate::MetadataFilter references known fields with compatible operators.
Implementations§
Source§impl MetadataSchema
impl MetadataSchema
Sourcepub fn validate_filter(
&self,
filter: &MetadataFilter,
) -> MetadataValidationResult<()>
pub fn validate_filter( &self, filter: &MetadataFilter, ) -> MetadataValidationResult<()>
Validates a metadata filter against this schema.
§Errors
Returns an aggregate error containing every unknown field, invalid range
operator, and incompatible filter value discovered during this validation
pass. Unknown filter fields are accepted when the schema’s
UnknownFieldPolicy is UnknownFieldPolicy::Allow.
Source§impl MetadataSchema
impl MetadataSchema
Sourcepub fn builder() -> MetadataSchemaBuilder
pub fn builder() -> MetadataSchemaBuilder
Creates a schema builder.
Sourcepub fn field(&self, key: &str) -> Option<&MetadataField>
pub fn field(&self, key: &str) -> Option<&MetadataField>
Returns the field definition for key.
Sourcepub fn field_type(&self, key: &str) -> Option<DataType>
pub fn field_type(&self, key: &str) -> Option<DataType>
Returns the declared data type for key.
Sourcepub fn unknown_field_policy(&self) -> UnknownFieldPolicy
pub fn unknown_field_policy(&self) -> UnknownFieldPolicy
Returns the unknown-field policy.
Sourcepub fn fields(&self) -> impl Iterator<Item = (&str, &MetadataField)>
pub fn fields(&self) -> impl Iterator<Item = (&str, &MetadataField)>
Returns an iterator over schema fields in key-sorted order.
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 Default for MetadataSchema
impl Default for MetadataSchema
Source§impl<'de> Deserialize<'de> for MetadataSchema
impl<'de> Deserialize<'de> for MetadataSchema
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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 ==.Source§impl Serialize for MetadataSchema
impl Serialize for MetadataSchema
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoValueDefault<T> for T
impl<T> IntoValueDefault<T> for T
Source§fn into_value_default(self) -> T
fn into_value_default(self) -> T
Converts this argument into the default value.