Struct sval_fmt::DisplayToValue
source · pub struct DisplayToValue<V: ?Sized>(/* private fields */);
Expand description
Adapt a fmt::Display
into an sval::Value
.
Implementations§
source§impl<V: Display> DisplayToValue<V>
impl<V: Display> DisplayToValue<V>
sourcepub const fn new(value: V) -> DisplayToValue<V>
pub const fn new(value: V) -> DisplayToValue<V>
Adapt a fmt::Display
into an sval::Value
.
source§impl<V: Display + ?Sized> DisplayToValue<V>
impl<V: Display + ?Sized> DisplayToValue<V>
sourcepub const fn new_borrowed<'a>(value: &'a V) -> &'a DisplayToValue<V>
pub const fn new_borrowed<'a>(value: &'a V) -> &'a DisplayToValue<V>
Adapt a reference to a fmt::Display
into an sval::Value
.
Trait Implementations§
source§impl<T: Display> Value for DisplayToValue<T>
impl<T: Display> Value for DisplayToValue<T>
source§fn stream<'sval, S: Stream<'sval> + ?Sized>(
&'sval self,
stream: &mut S
) -> Result
fn stream<'sval, S: Stream<'sval> + ?Sized>( &'sval self, stream: &mut S ) -> Result
Stream this value through a
Stream
.source§fn to_f32(&self) -> Option<f32>
fn to_f32(&self) -> Option<f32>
Try convert this value into a 32bit binary floating point number.
Auto Trait Implementations§
impl<V: ?Sized> Freeze for DisplayToValue<V>where
V: Freeze,
impl<V: ?Sized> RefUnwindSafe for DisplayToValue<V>where
V: RefUnwindSafe,
impl<V: ?Sized> Send for DisplayToValue<V>where
V: Send,
impl<V: ?Sized> Sync for DisplayToValue<V>where
V: Sync,
impl<V: ?Sized> Unpin for DisplayToValue<V>where
V: Unpin,
impl<V: ?Sized> UnwindSafe for DisplayToValue<V>where
V: UnwindSafe,
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