Skip to main content

MetadataValidationError

Struct MetadataValidationError 

Source
pub struct MetadataValidationError { /* private fields */ }
Expand description

Aggregate error returned by schema-level validation APIs.

Unlike single-entry metadata accessors, schema validation can discover multiple independent issues in one pass. This type preserves all collected MetadataError values so callers can report or fix them together. Debug and Display share a bounded diagnostic traversal; use Self::issues to inspect the complete collection independently of formatting limits.

§Examples

use qubit_metadata::{MetadataError, MetadataValidationError};

let error = MetadataValidationError::from_issue(MetadataError::MissingKey("tenant".into()));
assert_eq!(error.len(), 1);

Implementations§

Source§

impl MetadataValidationError

Source

pub fn from_issue(issue: MetadataError) -> Self

Creates an aggregate validation error from one issue.

§Parameters
  • issue - Validation issue to store.
§Returns

An aggregate error containing exactly one issue.

Source

pub fn from_issues(issues: Vec<MetadataError>) -> Option<Self>

Creates an aggregate validation error from a non-empty issue list.

Returns None when issues is empty because an empty validation error has no actionable meaning.

§Parameters
  • issues - Validation issues to aggregate.
§Returns

Some aggregate error for a non-empty list; otherwise, None.

Source

pub fn issues(&self) -> &[MetadataError]

Returns the collected validation issues.

§Returns

The issues in discovery order.

Source

pub fn len(&self) -> usize

Returns the number of collected validation issues.

§Returns

The issue count.

Source

pub fn into_issues(self) -> Vec<MetadataError>

Converts this aggregate error into its collected issues.

§Returns

The owned issues in discovery order.

Trait Implementations§

Source§

impl Clone for MetadataValidationError

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MetadataValidationError

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats a bounded diagnostic summary using the strict policy.

§Parameters
  • formatter - Destination receiving the diagnostic summary.
Source§

impl Display for MetadataValidationError

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the issue count and a bounded diagnostic view of the issues.

The complete issue collection remains available through issues(). Exhausted diagnostic budgets produce an explicit incomplete marker.

§Parameters
  • formatter - Formatter receiving the validation summary.
Source§

impl Eq for MetadataValidationError

Source§

impl Error for MetadataValidationError

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl PartialEq for MetadataValidationError

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Redact for MetadataValidationError

Source§

fn write_redacted(&self, writer: &mut RedactionWriter<'_>)

Writes admitted issues under one cumulative diagnostic budget.

Issue text is diagnostic data, not a confidentiality boundary for arbitrary keys or application-supplied error messages.

§Parameters
  • writer - Destination sharing output, node, and collection budgets.
Source§

impl StructuralPartialEq for MetadataValidationError

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoValueDefault<T> for T

Source§

fn into_value_default(self) -> T

Returns the owned value unchanged as the default.

§Returns

The input value, moved without cloning.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.