#[non_exhaustive]pub enum WeightsError {
Encoding(String),
MissingField(&'static str),
SchemaRejected(String),
Expired {
expires_at: DateTime<Utc>,
now: DateTime<Utc>,
},
BundleRejected(String),
CardMismatch {
expected: String,
found: String,
},
ScopeNotSubset {
scope: String,
},
ToolBanned {
tool: String,
},
}Expand description
Error variants emitted by the model-card surface.
Variants align with urn:chio:error:weights:* codes registered in
spec/errors/registry.yaml.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Encoding(String)
Canonical-JSON encoding or decoding failed. Fatal: do not retry until the encoding bug is resolved.
MissingField(&'static str)
Required field is missing from the model card structure.
SchemaRejected(String)
Schema-level invariant rejected (e.g. weights_hash not 64 hex chars).
Expired
Card expired before the verifier evaluated it.
BundleRejected(String)
Cosign bundle verify path rejected the bundle. Wraps the upstream
chio-attest-verify error so receipt consumers can correlate.
CardMismatch
Loaded weights_hash does not match the card’s weights_hash.
Maps to urn:chio:error:weights:card-mismatch.
Fields
ScopeNotSubset
Requested capability scope is not in the card’s
allowed_capability_set. Maps to
urn:chio:error:weights:scope-not-subset.
ToolBanned
Requested tool is in the card’s banned_tools. Maps to
urn:chio:error:weights:tool-banned.
Implementations§
Trait Implementations§
Source§impl Debug for WeightsError
impl Debug for WeightsError
Source§impl Display for WeightsError
impl Display for WeightsError
Source§impl Error for WeightsError
impl Error for WeightsError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for WeightsError
impl RefUnwindSafe for WeightsError
impl Send for WeightsError
impl Sync for WeightsError
impl Unpin for WeightsError
impl UnsafeUnpin for WeightsError
impl UnwindSafe for WeightsError
Blanket Implementations§
Source§impl<T> AsErrorSource for Twhere
T: Error + 'static,
impl<T> AsErrorSource for Twhere
T: Error + 'static,
Source§fn as_error_source(&self) -> &(dyn Error + 'static)
fn as_error_source(&self) -> &(dyn Error + 'static)
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.