pub struct ProviderDetail(/* private fields */);Expand description
The endpoint’s own sentence about why it refused, sanitized.
§Why this exists beside ErrorCode
A code says which family a failure belongs to. It cannot say what was
wrong with the request, and for the one family where that is the adopter’s
own bug — a malformed request — the difference between “the provider is
down” and “your function schema is missing properties” is the difference
between waiting and fixing. Finding the second took putting a proxy between
the process and the endpoint to read a body the runtime had already read
and thrown away.
§What it is not
It is not shown to a user and it is not in ProviderError’s Display,
which keeps its promise that what it renders is safe to log unconditionally.
This is the vendor’s words about a request this library sent: normally about
the request’s shape, and in principle able to quote a value from it. An
adapter passes it through the same Redactor the
code goes through, and construction here drops control characters, collapses
runs of whitespace and truncates on a character boundary.
Implementations§
Source§impl ProviderDetail
impl ProviderDetail
Sourcepub fn new(raw: impl AsRef<str>) -> Self
pub fn new(raw: impl AsRef<str>) -> Self
Sanitizes and truncates raw into a detail.
use turnframe_provider::error::ProviderDetail;
let detail = ProviderDetail::new("Invalid schema for function 'x':\n missing properties");
assert_eq!(
detail.as_str(),
"Invalid schema for function 'x': missing properties"
);Trait Implementations§
Source§impl Clone for ProviderDetail
impl Clone for ProviderDetail
Source§impl Debug for ProviderDetail
impl Debug for ProviderDetail
Source§impl<'de> Deserialize<'de> for ProviderDetail
impl<'de> Deserialize<'de> for ProviderDetail
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 ProviderDetail
impl Display for ProviderDetail
impl Eq for ProviderDetail
Source§impl Hash for ProviderDetail
impl Hash for ProviderDetail
Source§impl Ord for ProviderDetail
impl Ord for ProviderDetail
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for ProviderDetail
impl PartialEq for ProviderDetail
Source§impl PartialOrd for ProviderDetail
impl PartialOrd for ProviderDetail
Source§impl Serialize for ProviderDetail
impl Serialize for ProviderDetail
impl StructuralPartialEq for ProviderDetail
Auto Trait Implementations§
impl Freeze for ProviderDetail
impl RefUnwindSafe for ProviderDetail
impl Send for ProviderDetail
impl Sync for ProviderDetail
impl Unpin for ProviderDetail
impl UnsafeUnpin for ProviderDetail
impl UnwindSafe for ProviderDetail
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,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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.