Struct apollo_compiler::ast::FloatValue
source · pub struct FloatValue(/* private fields */);
Implementations§
source§impl FloatValue
impl FloatValue
sourcepub fn new_parsed(text: &str) -> Self
pub fn new_parsed(text: &str) -> Self
Constructs from a string matching the FloatValue
grammar specification
To convert an f64
, use from
or into
instead.
sourcepub fn try_to_f64(&self) -> Result<f64, FloatOverflowError>
pub fn try_to_f64(&self) -> Result<f64, FloatOverflowError>
Converts to a finite f64
, returning an error on overflow to infinity
Note: parsing is expected to succeed with a correctly-constructed FloatValue
,
leaving overflow as the only error case.
Trait Implementations§
source§impl Clone for FloatValue
impl Clone for FloatValue
source§fn clone(&self) -> FloatValue
fn clone(&self) -> FloatValue
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for FloatValue
impl Debug for FloatValue
source§impl Display for FloatValue
impl Display for FloatValue
source§impl From<f64> for FloatValue
impl From<f64> for FloatValue
source§impl Hash for FloatValue
impl Hash for FloatValue
source§impl PartialEq for FloatValue
impl PartialEq for FloatValue
source§fn eq(&self, other: &FloatValue) -> bool
fn eq(&self, other: &FloatValue) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for FloatValue
impl StructuralEq for FloatValue
impl StructuralPartialEq for FloatValue
Auto Trait Implementations§
impl RefUnwindSafe for FloatValue
impl Send for FloatValue
impl Sync for FloatValue
impl Unpin for FloatValue
impl UnwindSafe for FloatValue
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
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.