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
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 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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for TrustTaskCode
impl Display for TrustTaskCode
impl Eq for TrustTaskCode
Source§impl From<StandardCode> for TrustTaskCode
impl From<StandardCode> for TrustTaskCode
Source§fn from(code: StandardCode) -> TrustTaskCode
fn from(code: StandardCode) -> TrustTaskCode
Converts to this type from the input type.
Source§impl From<TrustTaskCode> for ErrorPayload
impl From<TrustTaskCode> for ErrorPayload
Source§fn from(code: TrustTaskCode) -> ErrorPayload
fn from(code: TrustTaskCode) -> ErrorPayload
Converts to this type from the input type.
Source§impl FromStr for TrustTaskCode
impl FromStr for TrustTaskCode
Source§type Err = ParseCodeError
type Err = ParseCodeError
The associated error which can be returned from parsing.
Source§fn from_str(s: &str) -> Result<TrustTaskCode, <TrustTaskCode as FromStr>::Err>
fn from_str(s: &str) -> Result<TrustTaskCode, <TrustTaskCode as FromStr>::Err>
Parses a string
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,
Serialize this value into the given Serde serializer. Read more
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
Mutably borrows from an owned value. Read more
Source§impl<T> BorrowUnordered for T
impl<T> BorrowUnordered for T
fn as_unordered(&self) -> &Unordered<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<'de, T, C> DeserializeTyped<'de, C> for Twhere
T: Deserialize<'de>,
impl<'de, T, C> DeserializeTyped<'de, C> for Twhere
T: Deserialize<'de>,
fn deserialize_typed<S>(
_: &C,
deserializer: S,
) -> Result<T, <S as Deserializer<'de>>::Error>where
S: Deserializer<'de>,
impl<T, U> DeserializeTypedOwned<T> for Uwhere
U: for<'de> DeserializeTyped<'de, T>,
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
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
fn equivalent(&self, key: &K) -> bool
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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
Compare self to
key and return true if they are equal.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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::RequestSource§impl<T, U, C> IntoWithContext<U, C> for Twhere
U: FromWithContext<T, C>,
impl<T, U, C> IntoWithContext<U, C> for Twhere
U: FromWithContext<T, C>,
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ResourceProvider<()> for T
impl<T> ResourceProvider<()> for T
Source§fn get_resource(&self) -> &()
fn get_resource(&self) -> &()
Returns a reference to the resource of type
T.