pub struct DataObject {
    pub data_ref: usize,
}
Expand description

Represents a map of type <String, ndata.Data>.

Fields

data_ref: usize

The pointer to the object in the object heap.

Implementations

Initialize global storage of objects. Call only once at startup.

Create a new (empty) object.

Get a reference to the object from the heap

Increase the reference count for this DataObject.

Decrease the reference count for this DataObject.

Create a new DataObject from a JSON string.

Create a JSON string from a DataObject.

Returns a new DataObject that points to the same underlying object instance.

Returns a new DataObject that points to a new object instance, which contains the same underlying data as the original.

Returns a new DataObject that points to a new object instance, which contains a recursively deep copy of the original underlying data.

Returns true if this object contains the given key.

Returns a list (Vec<String>) of the keys in this object.

Returns the stored value for the given key.

Returns the stored value for the given key as a String.

Returns the stored value for the given key as a bool.

Returns the stored value for the given key as an i64.

Returns the stored value for the given key as an f64.

Returns the stored value for the given key as a DataObject.

Returns the stored value for the given key as a DataArray.

Returns the stored value for the given key as a DataBytes.

Remove the value from the object for the given key.

Set the given value for the given key.

Set the given String value for the given key.

Set the given bool value for the given key.

Set the given i64 value for the given key.

Set the given f64 value for the given key.

Set the given DataObject value for the given key.

👎Deprecated since 0.1.2: please use put_array instead

Set the given DataArray value for the given key.

Set the given DataBytes value for the given key.

Set the for the given key to DNull.

DO NOT USE

Reduces the reference count for this object by one, as well as the reference counts of any objects, arrays, or byte buffers contained in this object. This function should only be used externally by DataArray::gc().

Returns the key value pairs in this object as a Vec<String, Data>.

Prints the objects currently stored in the heap

Perform garbage collection. Objects will not be removed from the heap until DataObject::gc() is called.

Trait Implementations

Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more

Adds this DataObject’s data_ref to ADROP. Reference counts are adjusted when DataObject::gc() is called.

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.