LLSDValue

Enum LLSDValue 

Source
pub enum LLSDValue {
    Undefined,
    Boolean(bool),
    Real(f64),
    Integer(i32),
    UUID(Uuid),
    String(String),
    Date(i64),
    URI(String),
    Binary(Vec<u8>),
    Map(HashMap<String, LLSDValue>),
    Array(Vec<LLSDValue>),
}
Expand description

The primitive LLSD data item. Serialization takes a tree of these. Deserialization returns a tree of these.

Variants§

§

Undefined

Not convertable.

§

Boolean(bool)

Boolean

§

Real(f64)

Real, always 64-bit.

§

Integer(i32)

Integer, always 32 bit, for historical reasons.

§

UUID(Uuid)

UUID, as a binary 128 bit value.

§

String(String)

String, UTF-8.

§

Date(i64)

Date, as seconds relative to the UNIX epoch, January 1, 1970.

§

URI(String)

Universal Resource Identifier

§

Binary(Vec<u8>)

Array of bytes.

§

Map(HashMap<String, LLSDValue>)

Key/value set of more LLSDValue items.

§

Array(Vec<LLSDValue>)

Array of more LLSDValue items.

Implementations§

Source§

impl LLSDValue

Source

pub fn is_undefined(&self) -> bool

Returns true if this is a LLSDValue::Undefined, otherwise false

Source

pub fn as_boolean_mut(&mut self) -> Option<&mut bool>

Optionally returns mutable references to the inner fields if this is a LLSDValue::Boolean, otherwise None

Source

pub fn as_boolean(&self) -> Option<&bool>

Optionally returns references to the inner fields if this is a LLSDValue::Boolean, otherwise None

Source

pub fn into_boolean(self) -> Result<bool, Self>

Returns the inner fields if this is a LLSDValue::Boolean, otherwise returns back the enum in the Err case of the result

Source

pub fn as_real_mut(&mut self) -> Option<&mut f64>

Optionally returns mutable references to the inner fields if this is a LLSDValue::Real, otherwise None

Source

pub fn as_real(&self) -> Option<&f64>

Optionally returns references to the inner fields if this is a LLSDValue::Real, otherwise None

Source

pub fn into_real(self) -> Result<f64, Self>

Returns the inner fields if this is a LLSDValue::Real, otherwise returns back the enum in the Err case of the result

Source

pub fn as_integer_mut(&mut self) -> Option<&mut i32>

Optionally returns mutable references to the inner fields if this is a LLSDValue::Integer, otherwise None

Source

pub fn as_integer(&self) -> Option<&i32>

Optionally returns references to the inner fields if this is a LLSDValue::Integer, otherwise None

Source

pub fn into_integer(self) -> Result<i32, Self>

Returns the inner fields if this is a LLSDValue::Integer, otherwise returns back the enum in the Err case of the result

Source

pub fn as_uuid_mut(&mut self) -> Option<&mut Uuid>

Optionally returns mutable references to the inner fields if this is a LLSDValue::UUID, otherwise None

Source

pub fn as_uuid(&self) -> Option<&Uuid>

Optionally returns references to the inner fields if this is a LLSDValue::UUID, otherwise None

Source

pub fn into_uuid(self) -> Result<Uuid, Self>

Returns the inner fields if this is a LLSDValue::UUID, otherwise returns back the enum in the Err case of the result

Source

pub fn as_string_mut(&mut self) -> Option<&mut String>

Optionally returns mutable references to the inner fields if this is a LLSDValue::String, otherwise None

Source

pub fn as_string(&self) -> Option<&String>

Optionally returns references to the inner fields if this is a LLSDValue::String, otherwise None

Source

pub fn into_string(self) -> Result<String, Self>

Returns the inner fields if this is a LLSDValue::String, otherwise returns back the enum in the Err case of the result

Source

pub fn as_date_mut(&mut self) -> Option<&mut i64>

Optionally returns mutable references to the inner fields if this is a LLSDValue::Date, otherwise None

Source

pub fn as_date(&self) -> Option<&i64>

Optionally returns references to the inner fields if this is a LLSDValue::Date, otherwise None

Source

pub fn into_date(self) -> Result<i64, Self>

Returns the inner fields if this is a LLSDValue::Date, otherwise returns back the enum in the Err case of the result

Source

pub fn as_uri_mut(&mut self) -> Option<&mut String>

Optionally returns mutable references to the inner fields if this is a LLSDValue::URI, otherwise None

Source

pub fn as_uri(&self) -> Option<&String>

Optionally returns references to the inner fields if this is a LLSDValue::URI, otherwise None

Source

pub fn into_uri(self) -> Result<String, Self>

Returns the inner fields if this is a LLSDValue::URI, otherwise returns back the enum in the Err case of the result

Source

pub fn as_binary_mut(&mut self) -> Option<&mut Vec<u8>>

Optionally returns mutable references to the inner fields if this is a LLSDValue::Binary, otherwise None

Source

pub fn as_binary(&self) -> Option<&Vec<u8>>

Optionally returns references to the inner fields if this is a LLSDValue::Binary, otherwise None

Source

pub fn into_binary(self) -> Result<Vec<u8>, Self>

Returns the inner fields if this is a LLSDValue::Binary, otherwise returns back the enum in the Err case of the result

Source

pub fn as_map_mut(&mut self) -> Option<&mut HashMap<String, LLSDValue>>

Optionally returns mutable references to the inner fields if this is a LLSDValue::Map, otherwise None

Source

pub fn as_map(&self) -> Option<&HashMap<String, LLSDValue>>

Optionally returns references to the inner fields if this is a LLSDValue::Map, otherwise None

Source

pub fn into_map(self) -> Result<HashMap<String, LLSDValue>, Self>

Returns the inner fields if this is a LLSDValue::Map, otherwise returns back the enum in the Err case of the result

Source

pub fn as_array_mut(&mut self) -> Option<&mut Vec<LLSDValue>>

Optionally returns mutable references to the inner fields if this is a LLSDValue::Array, otherwise None

Source

pub fn as_array(&self) -> Option<&Vec<LLSDValue>>

Optionally returns references to the inner fields if this is a LLSDValue::Array, otherwise None

Source

pub fn into_array(self) -> Result<Vec<LLSDValue>, Self>

Returns the inner fields if this is a LLSDValue::Array, otherwise returns back the enum in the Err case of the result

Trait Implementations§

Source§

impl Clone for LLSDValue

Source§

fn clone(&self) -> LLSDValue

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for LLSDValue

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for LLSDValue

Source§

fn eq(&self, other: &LLSDValue) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for LLSDValue

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.