Enum bluejay_core::ValueReference
source · pub enum ValueReference<'a, const CONST: bool, V: Value<CONST>> {
Variable(&'a V::Variable),
Integer(i32),
Float(f64),
String(&'a str),
Boolean(bool),
Null,
Enum(&'a str),
List(&'a V::List),
Object(&'a V::Object),
}Variants§
Variable(&'a V::Variable)
Integer(i32)
Float(f64)
String(&'a str)
Boolean(bool)
Null
Enum(&'a str)
List(&'a V::List)
Object(&'a V::Object)
Implementations§
source§impl<'a, const CONST: bool, V: Value<CONST>> ValueReference<'a, CONST, V>
impl<'a, const CONST: bool, V: Value<CONST>> ValueReference<'a, CONST, V>
sourcepub fn is_variable(&self) -> bool
pub fn is_variable(&self) -> bool
Returns true if this is a ValueReference::Variable, otherwise false
sourcepub fn as_variable_mut(&mut self) -> Option<&mut &'a V::Variable>
pub fn as_variable_mut(&mut self) -> Option<&mut &'a V::Variable>
Optionally returns mutable references to the inner fields if this is a ValueReference::Variable, otherwise None
sourcepub fn as_variable(&self) -> Option<&&'a V::Variable>
pub fn as_variable(&self) -> Option<&&'a V::Variable>
Optionally returns references to the inner fields if this is a ValueReference::Variable, otherwise None
sourcepub fn into_variable(self) -> Result<&'a V::Variable, Self>
pub fn into_variable(self) -> Result<&'a V::Variable, Self>
Returns the inner fields if this is a ValueReference::Variable, otherwise returns back the enum in the Err case of the result
sourcepub fn is_integer(&self) -> bool
pub fn is_integer(&self) -> bool
Returns true if this is a ValueReference::Integer, otherwise false
sourcepub fn as_integer_mut(&mut self) -> Option<&mut i32>
pub fn as_integer_mut(&mut self) -> Option<&mut i32>
Optionally returns mutable references to the inner fields if this is a ValueReference::Integer, otherwise None
sourcepub fn as_integer(&self) -> Option<&i32>
pub fn as_integer(&self) -> Option<&i32>
Optionally returns references to the inner fields if this is a ValueReference::Integer, otherwise None
sourcepub fn into_integer(self) -> Result<i32, Self>
pub fn into_integer(self) -> Result<i32, Self>
Returns the inner fields if this is a ValueReference::Integer, otherwise returns back the enum in the Err case of the result
sourcepub fn is_float(&self) -> bool
pub fn is_float(&self) -> bool
Returns true if this is a ValueReference::Float, otherwise false
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 ValueReference::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 ValueReference::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 ValueReference::Float, otherwise returns back the enum in the Err case of the result
sourcepub fn is_string(&self) -> bool
pub fn is_string(&self) -> bool
Returns true if this is a ValueReference::String, otherwise false
sourcepub fn as_string_mut(&mut self) -> Option<&mut &'a str>
pub fn as_string_mut(&mut self) -> Option<&mut &'a str>
Optionally returns mutable references to the inner fields if this is a ValueReference::String, otherwise None
sourcepub fn as_string(&self) -> Option<&&'a str>
pub fn as_string(&self) -> Option<&&'a str>
Optionally returns references to the inner fields if this is a ValueReference::String, otherwise None
sourcepub fn into_string(self) -> Result<&'a str, Self>
pub fn into_string(self) -> Result<&'a str, Self>
Returns the inner fields if this is a ValueReference::String, 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 ValueReference::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 ValueReference::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 ValueReference::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 ValueReference::Boolean, otherwise returns back the enum in the Err case of the result
sourcepub fn as_enum_mut(&mut self) -> Option<&mut &'a str>
pub fn as_enum_mut(&mut self) -> Option<&mut &'a str>
Optionally returns mutable references to the inner fields if this is a ValueReference::Enum, otherwise None
sourcepub fn as_enum(&self) -> Option<&&'a str>
pub fn as_enum(&self) -> Option<&&'a str>
Optionally returns references to the inner fields if this is a ValueReference::Enum, otherwise None
sourcepub fn into_enum(self) -> Result<&'a str, Self>
pub fn into_enum(self) -> Result<&'a str, Self>
Returns the inner fields if this is a ValueReference::Enum, otherwise returns back the enum in the Err case of the result
sourcepub fn as_list_mut(&mut self) -> Option<&mut &'a V::List>
pub fn as_list_mut(&mut self) -> Option<&mut &'a V::List>
Optionally returns mutable references to the inner fields if this is a ValueReference::List, otherwise None
sourcepub fn as_list(&self) -> Option<&&'a V::List>
pub fn as_list(&self) -> Option<&&'a V::List>
Optionally returns references to the inner fields if this is a ValueReference::List, otherwise None
sourcepub fn into_list(self) -> Result<&'a V::List, Self>
pub fn into_list(self) -> Result<&'a V::List, Self>
Returns the inner fields if this is a ValueReference::List, otherwise returns back the enum in the Err case of the result
sourcepub fn is_object(&self) -> bool
pub fn is_object(&self) -> bool
Returns true if this is a ValueReference::Object, otherwise false
sourcepub fn as_object_mut(&mut self) -> Option<&mut &'a V::Object>
pub fn as_object_mut(&mut self) -> Option<&mut &'a V::Object>
Optionally returns mutable references to the inner fields if this is a ValueReference::Object, otherwise None
sourcepub fn as_object(&self) -> Option<&&'a V::Object>
pub fn as_object(&self) -> Option<&&'a V::Object>
Optionally returns references to the inner fields if this is a ValueReference::Object, otherwise None
sourcepub fn into_object(self) -> Result<&'a V::Object, Self>
pub fn into_object(self) -> Result<&'a V::Object, Self>
Returns the inner fields if this is a ValueReference::Object, otherwise returns back the enum in the Err case of the result