Content-Length: 10245 | pFad | https://doc.rust-lang.org/reference/../std/process/../fmt/type.Result.html

Result in std::fmt - Rust

Result

Type Alias Result 

1.0.0 · Source
pub type Result = Result<(), Error>;
Expand description

The type returned by formatter methods.

§Examples

use std::fmt;

#[derive(Debug)]
struct Triangle {
    a: f32,
    b: f32,
    c: f32
}

impl fmt::Display for Triangle {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        write!(f, "({}, {}, {})", self.a, self.b, self.c)
    }
}

let pythagorean_triple = Triangle { a: 3.0, b: 4.0, c: 5.0 };

assert_eq!(format!("{pythagorean_triple}"), "(3, 4, 5)");

Aliased Type§

pub enum Result {
    Ok(()),
    Err(Error),
}

Variants§

§1.0.0

Ok(())

Contains the success value

§1.0.0

Err(Error)

Contains the error value









ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://doc.rust-lang.org/reference/../std/process/../fmt/type.Result.html

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy