pub struct PanicVal<'a> { /* private fields */ }
Expand description
An opaque enum of the values that this crate knows how to format, along with some formatting metadata.
This has constructor functions to make a PanicVal
from:
bool
- Integers
&str
- Arrays/Slices of primitives (with the “non_basic” feature, enabled by default)
ShortString
(with the “non_basic” feature, enabled by default)
Implementations§
Source§impl<'a> PanicVal<'a>
impl<'a> PanicVal<'a>
Sourcepub const fn with_leftpad(self, fmtarg: FmtArg) -> Self
pub const fn with_leftpad(self, fmtarg: FmtArg) -> Self
Sets the amount of spaces printed before this to fmtarg.indentation
.
Note that only strings can be padded.
Sourcepub const fn with_rightpad(self, fmtarg: FmtArg) -> Self
pub const fn with_rightpad(self, fmtarg: FmtArg) -> Self
Sets the amount of spaces printed after this to fmtarg.indentation
.
Note that only strings can be padded.
Source§impl<'a> PanicVal<'a>
impl<'a> PanicVal<'a>
Sourcepub const fn to_panicvals(&self, _: FmtArg) -> [PanicVal<'a>; 1]
pub const fn to_panicvals(&self, _: FmtArg) -> [PanicVal<'a>; 1]
Wraps this PanicVal
in a single-element array.
Sourcepub const fn to_panicval(&self, _: FmtArg) -> PanicVal<'a>
pub const fn to_panicval(&self, _: FmtArg) -> PanicVal<'a>
Returns a copy of this PanicVal
.
Source§impl PanicVal<'_>
impl PanicVal<'_>
Sourcepub const fn from_usize(this: usize, f: FmtArg) -> PanicVal<'static>
pub const fn from_usize(this: usize, f: FmtArg) -> PanicVal<'static>
Constructs this PanicVal
from an integer.
Source§impl PanicVal<'_>
impl PanicVal<'_>
Sourcepub const fn from_isize(this: isize, f: FmtArg) -> PanicVal<'static>
pub const fn from_isize(this: isize, f: FmtArg) -> PanicVal<'static>
Constructs this PanicVal
from an integer.
Trait Implementations§
Source§impl PanicFmt for PanicVal<'_>
impl PanicFmt for PanicVal<'_>
impl<'a> Copy for PanicVal<'a>
Auto Trait Implementations§
impl<'a> Freeze for PanicVal<'a>
impl<'a> RefUnwindSafe for PanicVal<'a>
impl<'a> Send for PanicVal<'a>
impl<'a> Sync for PanicVal<'a>
impl<'a> Unpin for PanicVal<'a>
impl<'a> UnwindSafe for PanicVal<'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