pub struct RemoteFailure { /* private fields */ }Expand description
An opaque remote failure, including failures inside successful batch or hosted results.
Serialization deliberately exports all retained native evidence, including the bounded body. It is not a redacted logging format. Deserialization rejects invalid categories, inconsistent evidence and values exceeding the documented bounds.
use providers_kit::error::{ErrorKind, NativeErrorDetails, RemoteFailure};
let failure = RemoteFailure::new(ErrorKind::NotFound, NativeErrorDetails::default())?;
assert_eq!(failure.kind(), ErrorKind::NotFound);
Implementations§
Source§impl RemoteFailure
impl RemoteFailure
Sourcepub fn new(
kind: ErrorKind,
details: NativeErrorDetails,
) -> Result<Self, KitError>
pub fn new( kind: ErrorKind, details: NativeErrorDetails, ) -> Result<Self, KitError>
Constructs an explicitly classified caller failure without claiming native inference.
Details must already fit 64 KiB per string, 1 MiB total string bytes, and 256 repeated records. Oversized caller evidence is rejected rather than discarded.
§Errors
Returns an input error for local-only categories, invalid numeric/detail fields, or evidence exceeding the documented capture bounds. Explicit classification does not authenticate origin or establish retry safety.
§Examples
use providers_kit::error::{RemoteFailure, NativeErrorDetails, ErrorKind, ClassificationBasis};
let failure = RemoteFailure::new(ErrorKind::NotFound, NativeErrorDetails { message: Some("private detail".into()), ..Default::default() })?;
assert_eq!(failure.kind(), ErrorKind::NotFound);
assert_eq!(failure.classification_basis(), ClassificationBasis::Explicit);
assert_eq!(failure.native_details().message.as_deref(), Some("private detail"));
assert!(!format!("{failure:?}").contains("private detail"));
Sourcepub fn kind(&self) -> ErrorKind
pub fn kind(&self) -> ErrorKind
Returns the same portable classification vocabulary used by KitError.
§Examples
use providers_kit::error::{RemoteFailure, NativeErrorDetails, ErrorKind, ClassificationBasis};
let failure = RemoteFailure::new(ErrorKind::NotFound, NativeErrorDetails { message: Some("private detail".into()), ..Default::default() })?;
assert_eq!(failure.kind(), ErrorKind::NotFound);
assert_eq!(failure.classification_basis(), ClassificationBasis::Explicit);
assert_eq!(failure.native_details().message.as_deref(), Some("private detail"));
assert!(!format!("{failure:?}").contains("private detail"));
Sourcepub fn classification_basis(&self) -> ClassificationBasis
pub fn classification_basis(&self) -> ClassificationBasis
Returns the evidence used for classification, independently of the retained body.
§Examples
use providers_kit::error::{RemoteFailure, NativeErrorDetails, ErrorKind, ClassificationBasis};
let failure = RemoteFailure::new(ErrorKind::NotFound, NativeErrorDetails { message: Some("private detail".into()), ..Default::default() })?;
assert_eq!(failure.kind(), ErrorKind::NotFound);
assert_eq!(failure.classification_basis(), ClassificationBasis::Explicit);
assert_eq!(failure.native_details().message.as_deref(), Some("private detail"));
assert!(!format!("{failure:?}").contains("private detail"));
Sourcepub fn native_details(&self) -> &NativeErrorDetails
pub fn native_details(&self) -> &NativeErrorDetails
Explicitly exposes potentially sensitive native evidence.
§Examples
use providers_kit::error::{RemoteFailure, NativeErrorDetails, ErrorKind, ClassificationBasis};
let failure = RemoteFailure::new(ErrorKind::NotFound, NativeErrorDetails { message: Some("private detail".into()), ..Default::default() })?;
assert_eq!(failure.kind(), ErrorKind::NotFound);
assert_eq!(failure.classification_basis(), ClassificationBasis::Explicit);
assert_eq!(failure.native_details().message.as_deref(), Some("private detail"));
assert!(!format!("{failure:?}").contains("private detail"));
Trait Implementations§
Source§impl Clone for RemoteFailure
impl Clone for RemoteFailure
Source§impl Debug for RemoteFailure
impl Debug for RemoteFailure
Source§impl<'de> Deserialize<'de> for RemoteFailure
impl<'de> Deserialize<'de> for RemoteFailure
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Source§impl Display for RemoteFailure
impl Display for RemoteFailure
impl Eq for RemoteFailure
Source§impl Error for RemoteFailure
impl Error for RemoteFailure
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()
Source§impl PartialEq for RemoteFailure
impl PartialEq for RemoteFailure
Source§impl Serialize for RemoteFailure
impl Serialize for RemoteFailure
impl StructuralPartialEq for RemoteFailure
Auto Trait Implementations§
impl Freeze for RemoteFailure
impl RefUnwindSafe for RemoteFailure
impl Send for RemoteFailure
impl Sync for RemoteFailure
impl Unpin for RemoteFailure
impl UnsafeUnpin for RemoteFailure
impl UnwindSafe for RemoteFailure
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§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.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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> 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.