pub enum ErrPartsMode {
Probe {
prefix: String,
},
Serde {
prefix: String,
spec: SerdeErrorSpec,
},
}Expand description
How the generated Err arm turns an error value into condition parts
(message, class vector, structured data).
Variants§
Probe
Autoref-specialisation probe (__mx_result_err_parts!): under the API
crate’s serde feature, the shape serde_error_shape! declared for the
error type in this crate, if any; else RConditionData when the error
type implements it; else, under serde, the serde shape for an
E: Serialize + Display with prefix (<crate>_error) as the family
class; Debug otherwise.
Serde
#[miniextendr(serde_error(..))]: serialize the error with serde; the enum
variant becomes the member class <prefix>_<variant>, the payload fields
become the condition’s data. prefix is the crate default (<crate>_error);
the shape declared for the error type, the spec’s named shape and its
own options (tag, prefix, skip, rename, as_*) reach
serde_err_parts as SerdeErrorShapes, applied in that order.
Implementations§
Source§impl ErrPartsMode
impl ErrPartsMode
Sourcepub fn from_spec(spec: Option<&SerdeErrorSpec>) -> Self
pub fn from_spec(spec: Option<&SerdeErrorSpec>) -> Self
Resolve a parsed serde_error spec (or its absence) into a mode.
Sourcepub fn expr(&self) -> TokenStream
pub fn expr(&self) -> TokenStream
The expression yielding an ErrParts from the bound error e.
Trait Implementations§
Source§impl Clone for ErrPartsMode
impl Clone for ErrPartsMode
Source§impl Debug for ErrPartsMode
impl Debug for ErrPartsMode
Source§impl Eq for ErrPartsMode
impl Eq for ErrPartsMode
Source§#[doc(hidden)]fn assert_fields_are_eq(&self)
#[doc(hidden)]fn assert_fields_are_eq(&self)
derive_eq_internals)1.0.0 (const: unstable) · Source§#[doc(hidden)]fn assert_receiver_is_total_eq(&self)
#[doc(hidden)]fn assert_receiver_is_total_eq(&self)
implementation detail of #[derive(Eq)]
Source§impl PartialEq for ErrPartsMode
impl PartialEq for ErrPartsMode
impl StructuralPartialEq for ErrPartsMode
Auto Trait Implementations§
impl !Send for ErrPartsMode
impl !Sync for ErrPartsMode
impl Freeze for ErrPartsMode
impl RefUnwindSafe for ErrPartsMode
impl Unpin for ErrPartsMode
impl UnsafeUnpin for ErrPartsMode
impl UnwindSafe for ErrPartsMode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> SizeHint for Twhere
T: ?Sized,
impl<T> SizeHint for Twhere
T: ?Sized,
Source§default fn lower_bound(&self) -> usize
default fn lower_bound(&self) -> usize
core_io_internals)[u8; 12] could return any value between 0 and
12 inclusively as a correct implementation. Read moreSource§impl<T> SizedTypeProperties for T
impl<T> SizedTypeProperties for T
Source§#[doc(hidden)]const SIZE: usize = _
#[doc(hidden)]const SIZE: usize = _
sized_type_properties)Source§#[doc(hidden)]const ALIGN: usize = _
#[doc(hidden)]const ALIGN: usize = _
sized_type_properties)Source§#[doc(hidden)]const ALIGNMENT: Alignment = _
#[doc(hidden)]const ALIGNMENT: Alignment = _
ptr_alignment_type)Source§#[doc(hidden)]const IS_ZST: bool = _
#[doc(hidden)]const IS_ZST: bool = _
sized_type_properties)Source§#[doc(hidden)]const LAYOUT: Layout = _
#[doc(hidden)]const LAYOUT: Layout = _
sized_type_properties)Source§#[doc(hidden)]const MAX_SLICE_LEN: usize = _
#[doc(hidden)]const MAX_SLICE_LEN: usize = _
sized_type_properties)[Self]. Read moreLayout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 200 bytes
Size for each variant:
Probe: 32 bytesSerde: 200 bytes