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

Represents an array of type ndata.Data.

Fields

data_ref: usize

The pointer to the array in the array heap.

Implementations

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

Mirror global storage of arrays from another process. Call only once at startup.

Create a new (empty) array.

Get a reference to the array from the heap

Increase the reference count for this DataArray.

Decrease the reference count for this DataArray.

Create a new DataArray from a JSON string.

Create a JSON string from a DataArray.

Returns a new DataArray that points to the same underlying array instance.

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

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

Returns the length of the array.

Returns the index of a Data in the array

Push data if not already in array

Returns the index of a Data in the array

Returns the indexed value from the array

Returns the indexed value from the array as a String

Returns the indexed value from the array as a bool

Returns the indexed value from the array as an i64

Returns the indexed value from the array as an f64

Returns the indexed value from the array as a DataArray

Returns the indexed value from the array as a DataObject

Returns the indexed value from the array as a DataBytes

Append all values from another array

Append the given value to the end of the array

Append the given String to the end of the array

Append the given bool to the end of the array

Append the given i64 to the end of the array

Append the given f64 to the end of the array

Append the given DataObject to the end of the array

👎Deprecated since 0.1.2: please use push_array instead

Append the given DataArray to the end of the array

Append the given DataBytes to the end of the array

Replace the indexed value in the array

Replace the indexed value in the array with the given String.

Replace the indexed value in the array with the given bool.

Replace the indexed value in the array with the given i64.

Replace the indexed value in the array with the given f64.

Replace the indexed value in the array with the given DataObject.

Replace the indexed value in the array with the given DataArray.

Replace the indexed value in the array with the given DataBytes.

Remove the indexed value from the array

DO NOT USE

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

Returns this array as a Vec<Data>.

Prints the arrays currently stored in the heap

Perform garbage collection. Arrays will not be removed from the heap until DataArray::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 DataArray’s data_ref to ODROP. Reference counts are adjusted when DataArray::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.