pub struct FaultString { /* private fields */ }Expand description
A fault’s diagnostic message.
Carries a human-readable description of a fault on the host and nothing at
all on a guest. Encodes to zero bytes regardless — see the module docs.
Two FaultStrings are always equal: the message is diagnostic, so it is
not part of the value’s identity, and comparisons behave the same on host
and guest.
Implementations§
Source§impl FaultString
impl FaultString
Sourcepub fn as_str(&self) -> &str
pub fn as_str(&self) -> &str
The message, or "<fault>" when none was recorded.
Host-only: a guest records no message, so there is nothing for this to return and it does not exist there. Reading a fault’s text is a diagnostic act, and diagnostics are a host concern.
Sourcepub fn via_display<V>(v: &V) -> Self
pub fn via_display<V>(v: &V) -> Self
Record v’s Display form as the message. A message longer than CAP
is replaced with <too-big>.
Sourcepub fn from_display(s: impl Display) -> Self
pub fn from_display(s: impl Display) -> Self
via_display for a value passed by value.
Trait Implementations§
Source§impl Clone for FaultString
impl Clone for FaultString
Source§impl ConstMaxSize for FaultString
impl ConstMaxSize for FaultString
Source§impl ConstMaxSize for FaultString
impl ConstMaxSize for FaultString
Source§impl ContractTypeName for FaultString
impl ContractTypeName for FaultString
Source§const NAME: ContractSpecIdView<'static>
const NAME: ContractSpecIdView<'static>
The fully qualified id this type is known by in the contract spec. Read more
Source§impl ContractTypeRefSpec for FaultString
impl ContractTypeRefSpec for FaultString
Source§const INFO: ContractTypeInfo<'static>
const INFO: ContractTypeInfo<'static>
The type reference. Transitive type definitions are not carried here;
they are retained via the linker-anchor mechanism
(
__THRUPUT_SPEC_ANCHOR_ROOT) and resolved by spec-tool.Source§const SIGNED_PREIMAGE: Option<&'static ContractTypeView<'static>> = _
const SIGNED_PREIMAGE: Option<&'static ContractTypeView<'static>> = _
How this type appears as a signed-token preimage
(
ContractTypeView::SignedToken’s payload): the type itself by
default, or None for a type-erased payload (the SDK’s Opaque
overrides this).Source§impl ContractTypeSpec for FaultString
impl ContractTypeSpec for FaultString
Source§const TYPE_DEF: ContractTypeDefView<'static>
const TYPE_DEF: ContractTypeDefView<'static>
The type’s definition (struct, enum, or union) as a const view.
Source§impl Debug for FaultString
Available on non-RISC-V RV32 only.
impl Debug for FaultString
Available on non-RISC-V RV32 only.
Source§impl Default for FaultString
impl Default for FaultString
Source§impl Display for FaultString
Available on non-RISC-V RV32 only.
impl Display for FaultString
Available on non-RISC-V RV32 only.
impl Eq for FaultString
Source§impl Error for FaultString
Available on non-RISC-V RV32 only.
impl Error for FaultString
Available on non-RISC-V RV32 only.
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl PartialEq for FaultString
impl PartialEq for FaultString
Source§impl<'r> ReadXDR<'r> for FaultString
impl<'r> ReadXDR<'r> for FaultString
Source§impl WriteXDR for FaultString
impl WriteXDR for FaultString
Source§fn write_xdr<F, W: Writer<F>>(&self, _w: &mut W) -> WriteResult<()>
fn write_xdr<F, W: Writer<F>>(&self, _w: &mut W) -> WriteResult<()>
Writes this value as XDR data to the writer. Read more
Source§unsafe fn write_xdr_unchecked<F, W: WriterUnchecked<F>>(&self, _w: &mut W)
unsafe fn write_xdr_unchecked<F, W: WriterUnchecked<F>>(&self, _w: &mut W)
Writes this value as XDR data to the writer, without runtime checks. Read more
Auto Trait Implementations§
impl Freeze for FaultString
impl RefUnwindSafe for FaultString
impl Send for FaultString
impl Sync for FaultString
impl Unpin for FaultString
impl UnsafeUnpin for FaultString
impl UnwindSafe for FaultString
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