pub struct ValFormatter<'a> { /* private fields */ }Expand description
Formats a value for display.
Implementations§
Source§impl<'a> ValFormatter<'a>
impl<'a> ValFormatter<'a>
Sourcepub fn new(vm: &'a Vm, v: UnsafeVal) -> ValFormatter<'_>
pub fn new(vm: &'a Vm, v: UnsafeVal) -> ValFormatter<'_>
Create a new value formatter that implements display.
Sourcepub fn new_quoted(vm: &'a Vm, v: UnsafeVal) -> ValFormatter<'_>
pub fn new_quoted(vm: &'a Vm, v: UnsafeVal) -> ValFormatter<'_>
Create a new value formatter that implements display. Strings are printed in quotes. For example, a string containing the string test-string will print to “test-string”.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for ValFormatter<'a>
impl<'a> !RefUnwindSafe for ValFormatter<'a>
impl<'a> !Send for ValFormatter<'a>
impl<'a> !Sync for ValFormatter<'a>
impl<'a> Unpin for ValFormatter<'a>
impl<'a> !UnwindSafe for ValFormatter<'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
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read more