pub enum Literal {
Null,
Integer(i64),
Float(f64),
Boolean(bool),
String(String),
Date(String),
Time(String),
Timestamp(String),
ValueAndUnit(ValueAndUnit),
}Variants§
Null
Integer(i64)
Float(f64)
Boolean(bool)
String(String)
Date(String)
Time(String)
Timestamp(String)
ValueAndUnit(ValueAndUnit)
Implementations§
Source§impl Literal
impl Literal
Sourcepub fn is_integer(&self) -> bool
pub fn is_integer(&self) -> bool
Returns true if this is a Literal::Integer, otherwise false
Sourcepub fn as_integer_mut(&mut self) -> Option<&mut i64>
pub fn as_integer_mut(&mut self) -> Option<&mut i64>
Optionally returns mutable references to the inner fields if this is a Literal::Integer, otherwise None
Sourcepub fn as_integer(&self) -> Option<&i64>
pub fn as_integer(&self) -> Option<&i64>
Optionally returns references to the inner fields if this is a Literal::Integer, otherwise None
Sourcepub fn into_integer(self) -> Result<i64, Self>
pub fn into_integer(self) -> Result<i64, Self>
Returns the inner fields if this is a Literal::Integer, otherwise returns back the enum in the Err case of the result
Sourcepub fn as_float_mut(&mut self) -> Option<&mut f64>
pub fn as_float_mut(&mut self) -> Option<&mut f64>
Optionally returns mutable references to the inner fields if this is a Literal::Float, otherwise None
Sourcepub fn as_float(&self) -> Option<&f64>
pub fn as_float(&self) -> Option<&f64>
Optionally returns references to the inner fields if this is a Literal::Float, otherwise None
Sourcepub fn into_float(self) -> Result<f64, Self>
pub fn into_float(self) -> Result<f64, Self>
Returns the inner fields if this is a Literal::Float, otherwise returns back the enum in the Err case of the result
Sourcepub fn is_boolean(&self) -> bool
pub fn is_boolean(&self) -> bool
Returns true if this is a Literal::Boolean, otherwise false
Sourcepub fn as_boolean_mut(&mut self) -> Option<&mut bool>
pub fn as_boolean_mut(&mut self) -> Option<&mut bool>
Optionally returns mutable references to the inner fields if this is a Literal::Boolean, otherwise None
Sourcepub fn as_boolean(&self) -> Option<&bool>
pub fn as_boolean(&self) -> Option<&bool>
Optionally returns references to the inner fields if this is a Literal::Boolean, otherwise None
Sourcepub fn into_boolean(self) -> Result<bool, Self>
pub fn into_boolean(self) -> Result<bool, Self>
Returns the inner fields if this is a Literal::Boolean, otherwise returns back the enum in the Err case of the result
Sourcepub fn as_string_mut(&mut self) -> Option<&mut String>
pub fn as_string_mut(&mut self) -> Option<&mut String>
Optionally returns mutable references to the inner fields if this is a Literal::String, otherwise None
Sourcepub fn as_string(&self) -> Option<&String>
pub fn as_string(&self) -> Option<&String>
Optionally returns references to the inner fields if this is a Literal::String, otherwise None
Sourcepub fn into_string(self) -> Result<String, Self>
pub fn into_string(self) -> Result<String, Self>
Returns the inner fields if this is a Literal::String, otherwise returns back the enum in the Err case of the result
Sourcepub fn as_date_mut(&mut self) -> Option<&mut String>
pub fn as_date_mut(&mut self) -> Option<&mut String>
Optionally returns mutable references to the inner fields if this is a Literal::Date, otherwise None
Sourcepub fn as_date(&self) -> Option<&String>
pub fn as_date(&self) -> Option<&String>
Optionally returns references to the inner fields if this is a Literal::Date, otherwise None
Sourcepub fn into_date(self) -> Result<String, Self>
pub fn into_date(self) -> Result<String, Self>
Returns the inner fields if this is a Literal::Date, otherwise returns back the enum in the Err case of the result
Sourcepub fn as_time_mut(&mut self) -> Option<&mut String>
pub fn as_time_mut(&mut self) -> Option<&mut String>
Optionally returns mutable references to the inner fields if this is a Literal::Time, otherwise None
Sourcepub fn as_time(&self) -> Option<&String>
pub fn as_time(&self) -> Option<&String>
Optionally returns references to the inner fields if this is a Literal::Time, otherwise None
Sourcepub fn into_time(self) -> Result<String, Self>
pub fn into_time(self) -> Result<String, Self>
Returns the inner fields if this is a Literal::Time, otherwise returns back the enum in the Err case of the result
Sourcepub fn is_timestamp(&self) -> bool
pub fn is_timestamp(&self) -> bool
Returns true if this is a Literal::Timestamp, otherwise false
Sourcepub fn as_timestamp_mut(&mut self) -> Option<&mut String>
pub fn as_timestamp_mut(&mut self) -> Option<&mut String>
Optionally returns mutable references to the inner fields if this is a Literal::Timestamp, otherwise None
Sourcepub fn as_timestamp(&self) -> Option<&String>
pub fn as_timestamp(&self) -> Option<&String>
Optionally returns references to the inner fields if this is a Literal::Timestamp, otherwise None
Sourcepub fn into_timestamp(self) -> Result<String, Self>
pub fn into_timestamp(self) -> Result<String, Self>
Returns the inner fields if this is a Literal::Timestamp, otherwise returns back the enum in the Err case of the result
Sourcepub fn is_value_and_unit(&self) -> bool
pub fn is_value_and_unit(&self) -> bool
Returns true if this is a Literal::ValueAndUnit, otherwise false
Sourcepub fn as_value_and_unit_mut(&mut self) -> Option<&mut ValueAndUnit>
pub fn as_value_and_unit_mut(&mut self) -> Option<&mut ValueAndUnit>
Optionally returns mutable references to the inner fields if this is a Literal::ValueAndUnit, otherwise None
Sourcepub fn as_value_and_unit(&self) -> Option<&ValueAndUnit>
pub fn as_value_and_unit(&self) -> Option<&ValueAndUnit>
Optionally returns references to the inner fields if this is a Literal::ValueAndUnit, otherwise None
Sourcepub fn into_value_and_unit(self) -> Result<ValueAndUnit, Self>
pub fn into_value_and_unit(self) -> Result<ValueAndUnit, Self>
Returns the inner fields if this is a Literal::ValueAndUnit, otherwise returns back the enum in the Err case of the result