Skip to main content

to_fmt

Function to_fmt 

Source
pub fn to_fmt<T: ToJson + ?Sized, W: Write + ?Sized>(
    value: &T,
    writer: &mut W,
) -> Result<(), Error>
Expand description

Serialize value into any core::fmt::Write sink.

Returns the underlying Error (typed) on failure — including non-finite floats. For String targets prefer to_string; this entry point is for arbitrary fmt::Write consumers.