pub struct Real { /* private fields */ }Expand description
A property-list real number.
The value is always stored as an f64; a crate-internal flag records
whether it originated as a 64-bit float (“wide”) or a 32-bit one. The flag
drives the binary codec’s 0x22/0x23 tag choice and object uniquing but
never participates in the public API: equality and ordering compare the
numeric value only, with IEEE semantics (NaN is not equal to itself).
From<f32> builds a narrow real, From<f64> a wide one; XML- and
text-parsed reals are always wide.
§Examples
use apple_plist::Real;
assert_eq!(Real::from(32.0f32), Real::from(32.0f64));
assert_ne!(Real::from(f64::NAN), Real::from(f64::NAN));Implementations§
Trait Implementations§
impl Copy for Real
Source§impl<'de> Deserialize<'de> for Real
impl<'de> Deserialize<'de> for Real
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Real
impl RefUnwindSafe for Real
impl Send for Real
impl Sync for Real
impl Unpin for Real
impl UnsafeUnpin for Real
impl UnwindSafe for Real
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