std-type
fmt::Error and Result
A formatting error signals failure to write text. A destination can reject a fragment; earlier fragments may already have been written. This error has no detailed cause payload. Expected stdout (not executed): true Common mistake: Treating fmt::Error as a detailed domain validation error.
Formal Syntax & Structure
rust syntaxrust
fmt::Result = Result<(), fmt::Error>Working Example
Example Snippetrust
fn main() { use std::fmt::{self, Write}; struct Reject; impl Write for Reject { fn write_str(&mut self, _: &str) -> fmt::Result { Err(fmt::Error) } } println!("{}", write!(&mut Reject, "message").is_err());}