Struct uclicious::raw::object::Object

source ·
pub struct Object { /* private fields */ }
Expand description

Owned and mutable instance of UCL Object. All methods that do not require mutability should be implemented on ObjectRef instead.

Methods from Deref<Target = ObjectRef>§

source

pub fn as_mut_ptr(&mut self) -> *mut ucl_object_t

Return mutable pointer to inner struct.

source

pub fn as_ptr(&self) -> *const ucl_object_t

Return const pointer to inner struct.

source

pub fn deep_copy(&self) -> Object

Perform a deep copy

source

pub fn is_null(&self) -> bool

Returns true if this object is a null.

source

pub fn is_object(&self) -> bool

Returns true if this object is an object (think hashmap).

source

pub fn is_string(&self) -> bool

Returns true if this object is a string.

source

pub fn is_integer(&self) -> bool

Returns true if this object is an integer.

source

pub fn is_float(&self) -> bool

Returns true if this object is a float.

source

pub fn is_boolean(&self) -> bool

Returns true if this object is a boolean type.

source

pub fn is_array(&self) -> bool

Returns true if this object is an array.

source

pub fn is_time(&self) -> bool

Returns true if this object is a time/duration.

source

pub fn priority(&self) -> Priority

Get priority assigned to the object.

source

pub fn kind(&self) -> ucl_type_t

Get type/kind of given object

source

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

Get key assigned to the object

source

pub fn lookup<K: AsRef<str>>(&self, key: K) -> Option<ObjectRef>

Lookup a key within an object with type Object.

source

pub fn lookup_path<K: AsRef<str>>(&self, path: K) -> Option<ObjectRef>

Perform a nested lookup with dot notation.

source

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

Return string value or None.

source

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

Return an integer value or None.

source

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

Return a float number of seconds. Only works if object is time.

source

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

Return a float value or None. This function also works on time object.

source

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

Return a boolean value or None.

source

pub fn as_null(&self) -> Option<()>

Return () or None.

source

pub fn iter(&self) -> Iter<'_>

Preferred way to construct an iterator. Items returned by this iterator are always ObjectRef.

Trait Implementations§

source§

impl AsRef<ObjectRef> for Object

source§

fn as_ref(&self) -> &ObjectRef

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Borrow<ObjectRef> for Object

source§

fn borrow(&self) -> &ObjectRef

Immutably borrows from an owned value. Read more
source§

impl Clone for Object

source§

fn clone(&self) -> Self

Returns a copy 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 Object

source§

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

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

impl Deref for Object

§

type Target = ObjectRef

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl DerefMut for Object

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl Drop for Object

Objects may not actually dropped, but their reference count is decreased.

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl From<&str> for Object

source§

fn from(source: &str) -> Self

Converts to this type from the input type.
source§

impl From<bool> for Object

source§

fn from(source: bool) -> Self

Converts to this type from the input type.
source§

impl From<f64> for Object

source§

fn from(source: f64) -> Self

Converts to this type from the input type.
source§

impl From<i64> for Object

source§

fn from(source: i64) -> Self

Converts to this type from the input type.
source§

impl Ord for Object

source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl PartialEq<Object> for Object

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<Object> for Object

source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

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

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Eq for Object

source§

impl StructuralEq for Object

Auto Trait Implementations§

§

impl RefUnwindSafe for Object

§

impl !Send for Object

§

impl !Sync for Object

§

impl Unpin for Object

§

impl UnwindSafe for Object

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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 Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

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 Twhere U: FromObject<T>,

source§

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

§

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.