pub(crate) struct SafeDetail(String);Expand description
A bounded, zero-knowledge detail for a failure report. It is built only from vetted scalars
(status codes, exit codes, env var and error kind names), never an arbitrary String.
Tuple Fields§
§0: StringImplementations§
Source§impl SafeDetail
impl SafeDetail
Sourcepub(crate) const MAX_LEN: usize = 500
pub(crate) const MAX_LEN: usize = 500
Maximum byte length of a detail string (server contract).
Sourcefn truncate(s: String) -> String
fn truncate(s: String) -> String
Truncates s to at most Self::MAX_LEN bytes, on a char boundary.
pub(crate) fn from_exit_code(code: i32) -> Self
Sourcepub(crate) fn from_signal(signal: i32) -> Self
pub(crate) fn from_signal(signal: i32) -> Self
The signal number of a script ended by a signal.
Sourcepub(crate) fn from_missing_vars(names: &[String]) -> Self
pub(crate) fn from_missing_vars(names: &[String]) -> Self
Variable names are safe to report; values never are.
Sourcepub(crate) fn from_kind(kind: &'static str) -> Self
pub(crate) fn from_kind(kind: &'static str) -> Self
kind is a 'static constant such as "GraphRequest", never user-supplied input.
Sourcepub(crate) fn from_ldap_result_code(rc: u32) -> Self
pub(crate) fn from_ldap_result_code(rc: u32) -> Self
Only the code: diagnosticMessage and matchedDN can echo account names and DNs.
pub(crate) fn timed_out(secs: u64) -> Self
Sourcepub(crate) fn from_seal_rejection(reason: &'static str) -> Self
pub(crate) fn from_seal_rejection(reason: &'static str) -> Self
reason is a 'static constant naming the failed check, never a value from the claim or
blobs.
Sourcepub(crate) fn from_http_status_and_graph_code(
status: u16,
graph_code: Option<&str>,
) -> Self
pub(crate) fn from_http_status_and_graph_code( status: u16, graph_code: Option<&str>, ) -> Self
Never includes Graph’s error.message, which can echo user-supplied content.
pub(crate) fn as_str(&self) -> &str
Trait Implementations§
Source§impl Clone for SafeDetail
impl Clone for SafeDetail
Source§fn clone(&self) -> SafeDetail
fn clone(&self) -> SafeDetail
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 SafeDetail
impl Debug for SafeDetail
Source§impl Display for SafeDetail
impl Display for SafeDetail
impl Eq for SafeDetail
Source§impl PartialEq for SafeDetail
impl PartialEq for SafeDetail
impl StructuralPartialEq for SafeDetail
Auto Trait Implementations§
impl Freeze for SafeDetail
impl RefUnwindSafe for SafeDetail
impl Send for SafeDetail
impl Sync for SafeDetail
impl Unpin for SafeDetail
impl UnsafeUnpin for SafeDetail
impl UnwindSafe for SafeDetail
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
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
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> CompatExt for T
impl<T> CompatExt for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
Create a new handle for an Arc value Read more
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
Clone a handle Read more
§unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
Consume a handle, getting back the initial
Arc<> Read more§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more