#[non_exhaustive]pub enum MetadataWireEncodeError {
Budget(BudgetError<JsonResource, usize>),
Quantity {
resource: JsonResource,
source: QuantityConversionError,
},
Domain(MetadataError),
Syntax(JsonSyntaxError),
Json(JsonSerializationError),
Io(Error),
}Expand description
Failure returned by bounded metadata JSON encoding APIs.
§Examples
use qubit_metadata::MetadataWireEncodeError;
let error = MetadataWireEncodeError::Io(std::io::Error::other("closed"));
assert!(error.to_string().contains("closed"));Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Budget(BudgetError<JsonResource, usize>)
The JSON document exceeded one configured resource budget.
Tuple Fields
0: BudgetError<JsonResource, usize>Shared JSON resource budget that was exceeded.
Quantity
A native JSON measurement could not be represented by the budget quantity type.
Fields
resource: JsonResourceResource whose measurement failed to convert.
source: QuantityConversionErrorNative measurement conversion failure.
Domain(MetadataError)
The metadata value exceeds the strict V1 metadata wire contract.
The original domain error is preserved as the source.
Tuple Fields
0: MetadataErrorStructured metadata-domain failure.
Syntax(JsonSyntaxError)
The encoded value contains invalid JSON syntax.
Tuple Fields
0: JsonSyntaxErrorLexical JSON syntax failure.
Json(JsonSerializationError)
Strict JSON serialization rejected the value during bounded encoding.
Tuple Fields
0: JsonSerializationErrorJSON serialization failure.
Io(Error)
The destination writer rejected bounded JSON output.
Trait Implementations§
Source§impl Debug for MetadataWireEncodeError
impl Debug for MetadataWireEncodeError
Source§impl Display for MetadataWireEncodeError
impl Display for MetadataWireEncodeError
Source§impl Error for MetadataWireEncodeError
impl Error for MetadataWireEncodeError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the underlying budget, domain, syntax, JSON, or I/O error.
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()