Trait ruarango::Collection
source · pub trait Collection {
Show 15 methods
fn collections<'life0, 'async_trait>(
&'life0 self,
exclude_system: bool
) -> Pin<Box<dyn Future<Output = ArangoResult<Response<Vec<Collections>>>> + Send + 'async_trait>>
where
Self: 'async_trait,
'life0: 'async_trait;
fn collection<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str
) -> Pin<Box<dyn Future<Output = ArangoResult<Coll>> + Send + 'async_trait>>
where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn create<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 Config
) -> Pin<Box<dyn Future<Output = ArangoResult<Create>> + Send + 'async_trait>>
where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn drop<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
is_system: bool
) -> Pin<Box<dyn Future<Output = ArangoResult<Drop>> + Send + 'async_trait>>
where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn checksum<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
with_revisions: bool,
with_data: bool
) -> Pin<Box<dyn Future<Output = ArangoResult<Checksum>> + Send + 'async_trait>>
where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn count<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str
) -> Pin<Box<dyn Future<Output = ArangoResult<Count>> + Send + 'async_trait>>
where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn figures<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str
) -> Pin<Box<dyn Future<Output = ArangoResult<Figures>> + Send + 'async_trait>>
where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn revision<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str
) -> Pin<Box<dyn Future<Output = ArangoResult<Revision>> + Send + 'async_trait>>
where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn load<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
include_count: bool
) -> Pin<Box<dyn Future<Output = ArangoResult<Load>> + Send + 'async_trait>>
where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn load_indexes<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str
) -> Pin<Box<dyn Future<Output = ArangoResult<LoadIndexes>> + Send + 'async_trait>>
where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn modify_props<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
props: Props
) -> Pin<Box<dyn Future<Output = ArangoResult<ModifyProps>> + Send + 'async_trait>>
where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn recalculate_count<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str
) -> Pin<Box<dyn Future<Output = ArangoResult<RecalculateCount>> + Send + 'async_trait>>
where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn rename<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
name: &'life1 str,
new_name: &'life2 str
) -> Pin<Box<dyn Future<Output = ArangoResult<Rename>> + Send + 'async_trait>>
where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn truncate<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str
) -> Pin<Box<dyn Future<Output = ArangoResult<Truncate>> + Send + 'async_trait>>
where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn unload<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str
) -> Pin<Box<dyn Future<Output = ArangoResult<Unload>> + Send + 'async_trait>>
where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}
Expand description
Collection Operations
Required Methods§
sourcefn collections<'life0, 'async_trait>(
&'life0 self,
exclude_system: bool
) -> Pin<Box<dyn Future<Output = ArangoResult<Response<Vec<Collections>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn collections<'life0, 'async_trait>(
&'life0 self,
exclude_system: bool
) -> Pin<Box<dyn Future<Output = ArangoResult<Response<Vec<Collections>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns a vector of collection descriptions
Setting exclude_system
to true will exclude all system collections
from the output.
sourcefn collection<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str
) -> Pin<Box<dyn Future<Output = ArangoResult<Coll>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn collection<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str
) -> Pin<Box<dyn Future<Output = ArangoResult<Coll>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Return information about a single collection
sourcefn create<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 Config
) -> Pin<Box<dyn Future<Output = ArangoResult<Create>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 Config
) -> Pin<Box<dyn Future<Output = ArangoResult<Create>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Create a collection
sourcefn drop<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
is_system: bool
) -> Pin<Box<dyn Future<Output = ArangoResult<Drop>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn drop<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
is_system: bool
) -> Pin<Box<dyn Future<Output = ArangoResult<Drop>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Drop a collection
sourcefn checksum<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
with_revisions: bool,
with_data: bool
) -> Pin<Box<dyn Future<Output = ArangoResult<Checksum>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn checksum<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
with_revisions: bool,
with_data: bool
) -> Pin<Box<dyn Future<Output = ArangoResult<Checksum>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Will calculate a checksum of the meta-data (keys and optionally revision ids and optionally the document data) in the collection.
The checksum can be used to compare if two collections on different ArangoDB instances containing the same contents. The current revision of the collection is returned too so one can make sure the checksums are calculated for the same state of data.
By default, the checksum will only be calculated on the _key
system attribute
of the documents contained in the collection. For edge collections, the system
attributes _from
and _to
will also be included in the calculation.
Setting with_revisions
to true will include revision ids
(_rev system attributes) in the checksum.
Setting with_data
to true will include the user-defined document attributes
in the checksum
Note: Including user-defined attributes will make the checksumming slower. Note: this method is not available in a cluster.
sourcefn count<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str
) -> Pin<Box<dyn Future<Output = ArangoResult<Count>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn count<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str
) -> Pin<Box<dyn Future<Output = ArangoResult<Count>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
The number of documents in the collection. Note - this will always load the collection into memory.
sourcefn figures<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str
) -> Pin<Box<dyn Future<Output = ArangoResult<Figures>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn figures<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str
) -> Pin<Box<dyn Future<Output = ArangoResult<Figures>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Some figures and additional statistical information about the collection.
sourcefn revision<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str
) -> Pin<Box<dyn Future<Output = ArangoResult<Revision>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn revision<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str
) -> Pin<Box<dyn Future<Output = ArangoResult<Revision>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get the revision id for a collection The revision id is a server-generated string that clients can use to check whether data in a collection has changed since the last revision check.
sourcefn load<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
include_count: bool
) -> Pin<Box<dyn Future<Output = ArangoResult<Load>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
include_count: bool
) -> Pin<Box<dyn Future<Output = ArangoResult<Load>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Loads a collection into memory.
sourcefn load_indexes<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str
) -> Pin<Box<dyn Future<Output = ArangoResult<LoadIndexes>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_indexes<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str
) -> Pin<Box<dyn Future<Output = ArangoResult<LoadIndexes>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
load_indexes
tries to cache all index entries of this collection into memory.
This will iterate over all indexes of the collection and store the indexed values, not the entire document data in memory.
All lookups that could be found in the cache are much faster than lookups not stored in the cache so you get a nice performance boost. It is also guaranteed that the cache is consistent with the stored data.
For the time being this function is only useful on RocksDB storage engine, as in MMFiles engine all indexes are in memory anyways.
On RocksDB this function honors all memory limits, if the indexes you want to load are smaller than your memory limit this function guarantees that most index values are cached.
If the index is larger than your memory limit this function will fill up values up to this limit and for the time being there is no way to control which indexes of the collection should have priority over others.
sourcefn modify_props<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
props: Props
) -> Pin<Box<dyn Future<Output = ArangoResult<ModifyProps>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn modify_props<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
props: Props
) -> Pin<Box<dyn Future<Output = ArangoResult<ModifyProps>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Change the properties of a collection
Note: except for wait_for_sync
, journal_size
and schema
, collection
properties cannot be changed once a collection is created. To rename
a collection, the rename
endpoint must be used.
sourcefn recalculate_count<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str
) -> Pin<Box<dyn Future<Output = ArangoResult<RecalculateCount>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn recalculate_count<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str
) -> Pin<Box<dyn Future<Output = ArangoResult<RecalculateCount>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Recalculates the document count of a collection, if it ever becomes inconsistent.
Note: this method is specific for the RocksDB storage engine
sourcefn rename<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
name: &'life1 str,
new_name: &'life2 str
) -> Pin<Box<dyn Future<Output = ArangoResult<Rename>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn rename<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
name: &'life1 str,
new_name: &'life2 str
) -> Pin<Box<dyn Future<Output = ArangoResult<Rename>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Renames a collection
sourcefn truncate<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str
) -> Pin<Box<dyn Future<Output = ArangoResult<Truncate>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn truncate<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str
) -> Pin<Box<dyn Future<Output = ArangoResult<Truncate>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Removes all documents from the collection, but leaves the indexes intact.
sourcefn unload<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str
) -> Pin<Box<dyn Future<Output = ArangoResult<Unload>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn unload<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str
) -> Pin<Box<dyn Future<Output = ArangoResult<Unload>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Removes a collection from memory. This call does not delete any documents. You can use the collection afterwards, in which case it will be loaded into memory.