Struct gpoint::GPoint [−][src]
#[repr(transparent)]pub struct GPoint<Float>(pub Float);
Expand description
A wrapper around floats providing an implementation of Display
which uses
the underlying libc
’s printf()
with format "%g"
, for when you need to
match exactly what C a program would output.
Float
should be a floating point type, i.e. f32
or f64
.
Available formatting options:
use gpoint::GPoint;
assert!(format!("{}", GPoint(42f32)) == "42");
assert!(format!("{}", GPoint(42f64)) == "42");
assert!(format!("{:.3}", GPoint(1.2345)) == "1.23");
assert!(format!("{:4}", GPoint(42.)) == " 42");
assert!(format!("{:-4}", GPoint(42.)) == "42 ");
assert!(format!("{:04}", GPoint(42.)) == "0042");
assert!(format!("{:+}", GPoint(42.)) == "+42");
assert!(format!("{:#4}", GPoint(42.)) == "42.0000");
Tuple Fields
0: Float
Your floating point number you want to Display
Trait Implementations
Auto Trait Implementations
impl<Float> RefUnwindSafe for GPoint<Float> where
Float: RefUnwindSafe,
impl<Float> UnwindSafe for GPoint<Float> where
Float: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more