pub enum TrustTaskCode {
Standard(StandardCode),
Extended {
slug: String,
local: String,
},
}Expand description
An error code — either a framework-standard code (SPEC.md §8.3) or an extension code namespaced by a spec’s slug (SPEC.md §8.5).
Variants§
Standard(StandardCode)
One of the framework-defined codes recognized by every conforming consumer.
Extended
A specification-extended code in the form <slug>:<local>.
Implementations§
Source§impl TrustTaskCode
impl TrustTaskCode
Sourcepub fn new_extended(
slug: impl Into<String>,
local: impl Into<String>,
) -> Result<TrustTaskCode, ParseCodeError>
pub fn new_extended( slug: impl Into<String>, local: impl Into<String>, ) -> Result<TrustTaskCode, ParseCodeError>
Construct an extended code <slug>:<local> after validating both
halves against SPEC.md §8.5’s grammar (slug per §6.1, local per
spec.meta.schema.json’s errorCodes[].code pattern after the
colon). Returns ParseCodeError when either is malformed.
Round-trips cleanly through Display and
FromStr — a guarantee the hand-rolled
struct-literal form (TrustTaskCode::Extended { slug, local })
does not enforce.
Trait Implementations§
Source§impl Clone for TrustTaskCode
impl Clone for TrustTaskCode
Source§fn clone(&self) -> TrustTaskCode
fn clone(&self) -> TrustTaskCode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TrustTaskCode
impl Debug for TrustTaskCode
Source§impl<'de> Deserialize<'de> for TrustTaskCode
impl<'de> Deserialize<'de> for TrustTaskCode
Source§fn deserialize<__D>(
deserializer: __D,
) -> Result<TrustTaskCode, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
deserializer: __D,
) -> Result<TrustTaskCode, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Display for TrustTaskCode
impl Display for TrustTaskCode
impl Eq for TrustTaskCode
Source§impl From<DeclaredErrorCode> for TrustTaskCode
impl From<DeclaredErrorCode> for TrustTaskCode
Source§fn from(declared: DeclaredErrorCode) -> TrustTaskCode
fn from(declared: DeclaredErrorCode) -> TrustTaskCode
Infallible: the generator refuses to emit a code that does not parse,
so a DeclaredErrorCode from crate::specs always converts.
Source§impl From<StandardCode> for TrustTaskCode
impl From<StandardCode> for TrustTaskCode
Source§fn from(code: StandardCode) -> TrustTaskCode
fn from(code: StandardCode) -> TrustTaskCode
Source§impl From<TrustTaskCode> for ErrorPayload
impl From<TrustTaskCode> for ErrorPayload
Source§fn from(code: TrustTaskCode) -> ErrorPayload
fn from(code: TrustTaskCode) -> ErrorPayload
Source§impl FromStr for TrustTaskCode
impl FromStr for TrustTaskCode
Source§type Err = ParseCodeError
type Err = ParseCodeError
Source§fn from_str(s: &str) -> Result<TrustTaskCode, <TrustTaskCode as FromStr>::Err>
fn from_str(s: &str) -> Result<TrustTaskCode, <TrustTaskCode as FromStr>::Err>
s to return a value of this type. Read moreSource§impl PartialEq for TrustTaskCode
impl PartialEq for TrustTaskCode
Source§impl Serialize for TrustTaskCodewhere
TrustTaskCode: Display,
impl Serialize for TrustTaskCodewhere
TrustTaskCode: Display,
Source§fn serialize<__S>(
&self,
serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for TrustTaskCode
Auto Trait Implementations§
impl Freeze for TrustTaskCode
impl RefUnwindSafe for TrustTaskCode
impl Send for TrustTaskCode
impl Sync for TrustTaskCode
impl Unpin for TrustTaskCode
impl UnsafeUnpin for TrustTaskCode
impl UnwindSafe for TrustTaskCode
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.