pub struct FailureMessage(/* private fields */);Expand description
A bounded message explicitly approved for public error surfaces.
Construction validates shape, not confidentiality. Callers must supply a message that contains no secrets, prompts, private resource existence, stack traces, provider payloads, or internal implementation details.
Implementations§
Source§impl FailureMessage
impl FailureMessage
Sourcepub fn new(value: impl Into<String>) -> Result<Self, FailureMessageError>
pub fn new(value: impl Into<String>) -> Result<Self, FailureMessageError>
Validates and constructs a public-safe, single-line message.
§Errors
Returns FailureMessageError when the value is empty, oversized,
whitespace-padded, or contains a control, bidirectional formatting
control, line separator, or Unicode noncharacter.
Trait Implementations§
Source§impl AsRef<str> for FailureMessage
impl AsRef<str> for FailureMessage
Source§impl Borrow<str> for FailureMessage
impl Borrow<str> for FailureMessage
Source§impl Clone for FailureMessage
impl Clone for FailureMessage
Source§impl Debug for FailureMessage
impl Debug for FailureMessage
Source§impl<'de> Deserialize<'de> for FailureMessage
impl<'de> Deserialize<'de> for FailureMessage
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for FailureMessage
impl Display for FailureMessage
impl Eq for FailureMessage
Source§impl From<FailureMessage> for String
impl From<FailureMessage> for String
Source§fn from(value: FailureMessage) -> Self
fn from(value: FailureMessage) -> Self
Converts to this type from the input type.
Source§impl FromStr for FailureMessage
impl FromStr for FailureMessage
Source§impl Hash for FailureMessage
impl Hash for FailureMessage
Source§impl JsonSchema for FailureMessage
impl JsonSchema for FailureMessage
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(_: &mut SchemaGenerator) -> Schema
fn json_schema(_: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl Ord for FailureMessage
impl Ord for FailureMessage
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for FailureMessage
impl PartialEq for FailureMessage
Source§impl PartialOrd for FailureMessage
impl PartialOrd for FailureMessage
Source§impl Serialize for FailureMessage
impl Serialize for FailureMessage
impl StructuralPartialEq for FailureMessage
Source§impl TryFrom<&str> for FailureMessage
impl TryFrom<&str> for FailureMessage
Auto Trait Implementations§
impl Forget for FailureMessage
impl Freeze for FailureMessage
impl Move for FailureMessage
impl RefUnwindSafe for FailureMessage
impl Send for FailureMessage
impl Sync for FailureMessage
impl Unpin for FailureMessage
impl UnsafeUnpin for FailureMessage
impl UnwindSafe for FailureMessage
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