pub enum Llsd {
Undefined,
Boolean(bool),
Integer(i32),
Real(f64),
String(String),
Uri(Uri),
Uuid(Uuid),
Date(DateTime<Utc>),
Binary(Vec<u8>),
Array(Vec<Llsd>),
Map(HashMap<String, Llsd>),
}Variants§
Undefined
Boolean(bool)
Integer(i32)
Real(f64)
String(String)
Uri(Uri)
Uuid(Uuid)
Date(DateTime<Utc>)
Binary(Vec<u8>)
Array(Vec<Llsd>)
Map(HashMap<String, Llsd>)
Implementations§
Source§impl Llsd
impl Llsd
Sourcepub fn is_undefined(&self) -> bool
pub fn is_undefined(&self) -> bool
Returns true if this is a Llsd::Undefined, otherwise false
Sourcepub fn is_boolean(&self) -> bool
pub fn is_boolean(&self) -> bool
Returns true if this is a Llsd::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 Llsd::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 Llsd::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 Llsd::Boolean, otherwise returns back the enum in the Err case of the result
Sourcepub unsafe fn into_boolean_unchecked(self) -> bool
pub unsafe fn into_boolean_unchecked(self) -> bool
Unchecked return of the inner fields of Llsd::Boolean.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_boolean_unchecked(&self) -> &bool
pub unsafe fn as_boolean_unchecked(&self) -> &bool
Unchecked reference of the inner fields of Llsd::Boolean.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_boolean_mut_unchecked(&mut self) -> &mut bool
pub unsafe fn as_boolean_mut_unchecked(&mut self) -> &mut bool
Unchecked mutable reference of the inner fields of Llsd::Boolean.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub fn is_integer(&self) -> bool
pub fn is_integer(&self) -> bool
Returns true if this is a Llsd::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 Llsd::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 Llsd::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 Llsd::Integer, otherwise returns back the enum in the Err case of the result
Sourcepub unsafe fn into_integer_unchecked(self) -> i32
pub unsafe fn into_integer_unchecked(self) -> i32
Unchecked return of the inner fields of Llsd::Integer.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_integer_unchecked(&self) -> &i32
pub unsafe fn as_integer_unchecked(&self) -> &i32
Unchecked reference of the inner fields of Llsd::Integer.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_integer_mut_unchecked(&mut self) -> &mut i32
pub unsafe fn as_integer_mut_unchecked(&mut self) -> &mut i32
Unchecked mutable reference of the inner fields of Llsd::Integer.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub fn as_real_mut(&mut self) -> Option<&mut f64>
pub fn as_real_mut(&mut self) -> Option<&mut f64>
Optionally returns mutable references to the inner fields if this is a Llsd::Real, otherwise None
Sourcepub fn as_real(&self) -> Option<&f64>
pub fn as_real(&self) -> Option<&f64>
Optionally returns references to the inner fields if this is a Llsd::Real, otherwise None
Sourcepub fn into_real(self) -> Result<f64, Self>
pub fn into_real(self) -> Result<f64, Self>
Returns the inner fields if this is a Llsd::Real, otherwise returns back the enum in the Err case of the result
Sourcepub unsafe fn into_real_unchecked(self) -> f64
pub unsafe fn into_real_unchecked(self) -> f64
Unchecked return of the inner fields of Llsd::Real.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_real_unchecked(&self) -> &f64
pub unsafe fn as_real_unchecked(&self) -> &f64
Unchecked reference of the inner fields of Llsd::Real.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_real_mut_unchecked(&mut self) -> &mut f64
pub unsafe fn as_real_mut_unchecked(&mut self) -> &mut f64
Unchecked mutable reference of the inner fields of Llsd::Real.
§Safety
Results in undefined behavior when it is the incorrect variant.
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 Llsd::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 Llsd::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 Llsd::String, otherwise returns back the enum in the Err case of the result
Sourcepub unsafe fn into_string_unchecked(self) -> String
pub unsafe fn into_string_unchecked(self) -> String
Unchecked return of the inner fields of Llsd::String.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_string_unchecked(&self) -> &String
pub unsafe fn as_string_unchecked(&self) -> &String
Unchecked reference of the inner fields of Llsd::String.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_string_mut_unchecked(&mut self) -> &mut String
pub unsafe fn as_string_mut_unchecked(&mut self) -> &mut String
Unchecked mutable reference of the inner fields of Llsd::String.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub fn as_uri_mut(&mut self) -> Option<&mut Uri>
pub fn as_uri_mut(&mut self) -> Option<&mut Uri>
Optionally returns mutable references to the inner fields if this is a Llsd::Uri, otherwise None
Sourcepub fn as_uri(&self) -> Option<&Uri>
pub fn as_uri(&self) -> Option<&Uri>
Optionally returns references to the inner fields if this is a Llsd::Uri, otherwise None
Sourcepub fn into_uri(self) -> Result<Uri, Self>
pub fn into_uri(self) -> Result<Uri, Self>
Returns the inner fields if this is a Llsd::Uri, otherwise returns back the enum in the Err case of the result
Sourcepub unsafe fn into_uri_unchecked(self) -> Uri
pub unsafe fn into_uri_unchecked(self) -> Uri
Unchecked return of the inner fields of Llsd::Uri.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_uri_unchecked(&self) -> &Uri
pub unsafe fn as_uri_unchecked(&self) -> &Uri
Unchecked reference of the inner fields of Llsd::Uri.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_uri_mut_unchecked(&mut self) -> &mut Uri
pub unsafe fn as_uri_mut_unchecked(&mut self) -> &mut Uri
Unchecked mutable reference of the inner fields of Llsd::Uri.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub fn as_uuid_mut(&mut self) -> Option<&mut Uuid>
pub fn as_uuid_mut(&mut self) -> Option<&mut Uuid>
Optionally returns mutable references to the inner fields if this is a Llsd::Uuid, otherwise None
Sourcepub fn as_uuid(&self) -> Option<&Uuid>
pub fn as_uuid(&self) -> Option<&Uuid>
Optionally returns references to the inner fields if this is a Llsd::Uuid, otherwise None
Sourcepub fn into_uuid(self) -> Result<Uuid, Self>
pub fn into_uuid(self) -> Result<Uuid, Self>
Returns the inner fields if this is a Llsd::Uuid, otherwise returns back the enum in the Err case of the result
Sourcepub unsafe fn into_uuid_unchecked(self) -> Uuid
pub unsafe fn into_uuid_unchecked(self) -> Uuid
Unchecked return of the inner fields of Llsd::Uuid.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_uuid_unchecked(&self) -> &Uuid
pub unsafe fn as_uuid_unchecked(&self) -> &Uuid
Unchecked reference of the inner fields of Llsd::Uuid.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_uuid_mut_unchecked(&mut self) -> &mut Uuid
pub unsafe fn as_uuid_mut_unchecked(&mut self) -> &mut Uuid
Unchecked mutable reference of the inner fields of Llsd::Uuid.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub fn as_date_mut(&mut self) -> Option<&mut DateTime<Utc>>
pub fn as_date_mut(&mut self) -> Option<&mut DateTime<Utc>>
Optionally returns mutable references to the inner fields if this is a Llsd::Date, otherwise None
Sourcepub fn as_date(&self) -> Option<&DateTime<Utc>>
pub fn as_date(&self) -> Option<&DateTime<Utc>>
Optionally returns references to the inner fields if this is a Llsd::Date, otherwise None
Sourcepub fn into_date(self) -> Result<DateTime<Utc>, Self>
pub fn into_date(self) -> Result<DateTime<Utc>, Self>
Returns the inner fields if this is a Llsd::Date, otherwise returns back the enum in the Err case of the result
Sourcepub unsafe fn into_date_unchecked(self) -> DateTime<Utc>
pub unsafe fn into_date_unchecked(self) -> DateTime<Utc>
Unchecked return of the inner fields of Llsd::Date.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_date_unchecked(&self) -> &DateTime<Utc>
pub unsafe fn as_date_unchecked(&self) -> &DateTime<Utc>
Unchecked reference of the inner fields of Llsd::Date.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_date_mut_unchecked(&mut self) -> &mut DateTime<Utc>
pub unsafe fn as_date_mut_unchecked(&mut self) -> &mut DateTime<Utc>
Unchecked mutable reference of the inner fields of Llsd::Date.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub fn as_binary_mut(&mut self) -> Option<&mut Vec<u8>>
pub fn as_binary_mut(&mut self) -> Option<&mut Vec<u8>>
Optionally returns mutable references to the inner fields if this is a Llsd::Binary, otherwise None
Sourcepub fn as_binary(&self) -> Option<&Vec<u8>>
pub fn as_binary(&self) -> Option<&Vec<u8>>
Optionally returns references to the inner fields if this is a Llsd::Binary, otherwise None
Sourcepub fn into_binary(self) -> Result<Vec<u8>, Self>
pub fn into_binary(self) -> Result<Vec<u8>, Self>
Returns the inner fields if this is a Llsd::Binary, otherwise returns back the enum in the Err case of the result
Sourcepub unsafe fn into_binary_unchecked(self) -> Vec<u8> ⓘ
pub unsafe fn into_binary_unchecked(self) -> Vec<u8> ⓘ
Unchecked return of the inner fields of Llsd::Binary.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_binary_unchecked(&self) -> &Vec<u8> ⓘ
pub unsafe fn as_binary_unchecked(&self) -> &Vec<u8> ⓘ
Unchecked reference of the inner fields of Llsd::Binary.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_binary_mut_unchecked(&mut self) -> &mut Vec<u8> ⓘ
pub unsafe fn as_binary_mut_unchecked(&mut self) -> &mut Vec<u8> ⓘ
Unchecked mutable reference of the inner fields of Llsd::Binary.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub fn as_array_mut(&mut self) -> Option<&mut Vec<Llsd>>
pub fn as_array_mut(&mut self) -> Option<&mut Vec<Llsd>>
Optionally returns mutable references to the inner fields if this is a Llsd::Array, otherwise None
Sourcepub fn as_array(&self) -> Option<&Vec<Llsd>>
pub fn as_array(&self) -> Option<&Vec<Llsd>>
Optionally returns references to the inner fields if this is a Llsd::Array, otherwise None
Sourcepub fn into_array(self) -> Result<Vec<Llsd>, Self>
pub fn into_array(self) -> Result<Vec<Llsd>, Self>
Returns the inner fields if this is a Llsd::Array, otherwise returns back the enum in the Err case of the result
Sourcepub unsafe fn into_array_unchecked(self) -> Vec<Llsd>
pub unsafe fn into_array_unchecked(self) -> Vec<Llsd>
Unchecked return of the inner fields of Llsd::Array.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_array_unchecked(&self) -> &Vec<Llsd>
pub unsafe fn as_array_unchecked(&self) -> &Vec<Llsd>
Unchecked reference of the inner fields of Llsd::Array.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_array_mut_unchecked(&mut self) -> &mut Vec<Llsd>
pub unsafe fn as_array_mut_unchecked(&mut self) -> &mut Vec<Llsd>
Unchecked mutable reference of the inner fields of Llsd::Array.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub fn as_map_mut(&mut self) -> Option<&mut HashMap<String, Llsd>>
pub fn as_map_mut(&mut self) -> Option<&mut HashMap<String, Llsd>>
Optionally returns mutable references to the inner fields if this is a Llsd::Map, otherwise None
Sourcepub fn as_map(&self) -> Option<&HashMap<String, Llsd>>
pub fn as_map(&self) -> Option<&HashMap<String, Llsd>>
Optionally returns references to the inner fields if this is a Llsd::Map, otherwise None
Sourcepub fn into_map(self) -> Result<HashMap<String, Llsd>, Self>
pub fn into_map(self) -> Result<HashMap<String, Llsd>, Self>
Returns the inner fields if this is a Llsd::Map, otherwise returns back the enum in the Err case of the result
Sourcepub unsafe fn into_map_unchecked(self) -> HashMap<String, Llsd>
pub unsafe fn into_map_unchecked(self) -> HashMap<String, Llsd>
Unchecked return of the inner fields of Llsd::Map.
§Safety
Results in undefined behavior when it is the incorrect variant.