Struct wasmtime_environ::__core::panic::PanicMessage
source ยท pub struct PanicMessage<'a> { /* private fields */ }
๐ฌThis is a nightly-only experimental API. (
panic_info_message
)Expand description
A message that was given to the panic!()
macro.
The Display
implementation of this type will format the message with the arguments
that were given to the panic!()
macro.
See PanicInfo::message
.
Implementationsยง
sourceยงimpl<'a> PanicMessage<'a>
impl<'a> PanicMessage<'a>
sourcepub const fn as_str(&self) -> Option<&'static str>
๐ฌThis is a nightly-only experimental API. (panic_info_message
)
pub const fn as_str(&self) -> Option<&'static str>
panic_info_message
)Get the formatted message, if it has no arguments to be formatted at runtime.
This can be used to avoid allocations in some cases.
ยงGuarantees
For panic!("just a literal")
, this function is guaranteed to
return Some("just a literal")
.
For most cases with placeholders, this function will return None
.
See fmt::Arguments::as_str
for details.
Trait Implementationsยง
sourceยงimpl Debug for PanicMessage<'_>
impl Debug for PanicMessage<'_>
Auto Trait Implementationsยง
impl<'a> Freeze for PanicMessage<'a>
impl<'a> !RefUnwindSafe for PanicMessage<'a>
impl<'a> !Send for PanicMessage<'a>
impl<'a> !Sync for PanicMessage<'a>
impl<'a> Unpin for PanicMessage<'a>
impl<'a> !UnwindSafe for PanicMessage<'a>
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