pub struct QueryResultItem { /* private fields */ }
Expand description

Represents a single match of a DQL query, similar to a “row” in SQL terms. It’s a reference type serving as a “cursor”, allowing for efficient access of the underlying data in various formats.

The row is lazily materialized and kept in memory until it goes out of scope. To reduce the memory footprint, access the items using the provided iterator.

let cars: Vec<Car> = all_cars_query_result
    .iter()
    .map(|query_result_item| query_result_item.deserialize_value().unwrap())
    .collect();

Implementations

Returns the content as a materialized object.

The item’s value is .materialize()-ed on first access and subsequently on each access after performing .dematerialize(). Once materialized, the value is kept in memory until explicitly .dematerialize()-ed or the item goes out of scope.

Returns true if value is currently held materialized in memory, otherwise returns false.

See Also

Loads the CBOR representation of the item’s content, decodes it as a dictionary so it can be accessed via .value(). Keeps the dictionary in memory until .dematerialize() is called. No-op if value is already materialized.

Releases the materialized value from memory. No-op if item is not materialized.

Return the content of the item as a CBOR slice.

Important: The returned CBOR slice is not cached, make sure to call this method once and keep it for as long as needed.

Return the content of the item as a JSON string.

Important: The returned JSON string is not cached, make sure to call this method once and keep it for as long as needed.

Convenience around Self::cbor_data() deserialize-ing the value.

Important: The returned value is not cached, make sure to call this method once and keep it for as long as needed.

Trait Implementations

Converts to this type from the input type.

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
Applies the [Compat] adapter by value. Read more
Applies the [Compat] adapter by shared reference. Read more
Applies the [Compat] adapter by mutable reference. 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.

Converts to T by calling Into<T>::into.
Tries to convert to T by calling TryInto<T>::try_into.
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.