pub enum Number {
    PosInt(u64),
    NegInt(i64),
    Float(f64),
}
Expand description

Represents a HCL number.

Variants

PosInt(u64)

Represents a positive integer.

NegInt(i64)

Represents a negative integer.

Float(f64)

Represents a float.

Implementations

Represents the Number as f64 if possible. Returns None otherwise.

If the Number is an integer, represent it as i64 if possible. Returns None otherwise.

If the Number is an integer, represent it as u64 if possible. Returns None otherwise.

Returns true if the Number is a float.

For any Number on which is_f64 returns true, as_f64 is guaranteed to return the float value.

Returns true if the Number is an integer between i64::MIN and i64::MAX.

For any Number on which is_i64 returns true, as_i64 is guaranteed to return the integer value.

Returns true if the Number is an integer between zero and u64::MAX.

For any Number on which is_u64 returns true, as_u64 is guaranteed to return the integer value.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Formats the value using the given formatter. Read more

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.