Expand description
Rust std::collections exposed as R data structures.
Each collection is stored on the Interpreter struct in a Vec<CollectionObject>.
R sees a collection as an integer ID with a class attribute (e.g. "hashmap",
"btreemap", "hashset", "heap", "deque"). Functions like hashmap_set(),
hashset_add(), heap_push(), etc. mutate the collection in place through the ID.
This gives R users O(1) hash lookups, ordered maps, priority queues, and deques โ data structures that have no native equivalent in base R.
Structsยง
- OrdF64
- Wrapper around
f64that implementsOrdfor use inBinaryHeap.
Enumsยง
- Collection
Object - A single collection object stored on the interpreter.
Staticsยง
- __
INTERP_ ๐REG_ INTERP_ BTREEMAP - __
INTERP_ ๐REG_ INTERP_ BTREEMAP_ GET - __
INTERP_ ๐REG_ INTERP_ BTREEMAP_ HAS - __
INTERP_ ๐REG_ INTERP_ BTREEMAP_ KEYS - __
INTERP_ ๐REG_ INTERP_ BTREEMAP_ REMOVE - __
INTERP_ ๐REG_ INTERP_ BTREEMAP_ SET - __
INTERP_ ๐REG_ INTERP_ BTREEMAP_ SIZE - __
INTERP_ ๐REG_ INTERP_ BTREEMAP_ TO_ LIST - __
INTERP_ ๐REG_ INTERP_ BTREEMAP_ VALUES - __
INTERP_ ๐REG_ INTERP_ DEQUE - __
INTERP_ ๐REG_ INTERP_ DEQUE_ POP_ BACK - __
INTERP_ ๐REG_ INTERP_ DEQUE_ POP_ FRONT - __
INTERP_ ๐REG_ INTERP_ DEQUE_ PUSH_ BACK - __
INTERP_ ๐REG_ INTERP_ DEQUE_ PUSH_ FRONT - __
INTERP_ ๐REG_ INTERP_ DEQUE_ SIZE - __
INTERP_ ๐REG_ INTERP_ DEQUE_ TO_ LIST - __
INTERP_ ๐REG_ INTERP_ HASHMAP - __
INTERP_ ๐REG_ INTERP_ HASHMAP_ GET - __
INTERP_ ๐REG_ INTERP_ HASHMAP_ HAS - __
INTERP_ ๐REG_ INTERP_ HASHMAP_ KEYS - __
INTERP_ ๐REG_ INTERP_ HASHMAP_ REMOVE - __
INTERP_ ๐REG_ INTERP_ HASHMAP_ SET - __
INTERP_ ๐REG_ INTERP_ HASHMAP_ SIZE - __
INTERP_ ๐REG_ INTERP_ HASHMAP_ TO_ LIST - __
INTERP_ ๐REG_ INTERP_ HASHMAP_ VALUES - __
INTERP_ ๐REG_ INTERP_ HASHSET - __
INTERP_ ๐REG_ INTERP_ HASHSET_ ADD - __
INTERP_ ๐REG_ INTERP_ HASHSET_ DIFF - __
INTERP_ ๐REG_ INTERP_ HASHSET_ HAS - __
INTERP_ ๐REG_ INTERP_ HASHSET_ INTERSECT - __
INTERP_ ๐REG_ INTERP_ HASHSET_ REMOVE - __
INTERP_ ๐REG_ INTERP_ HASHSET_ SIZE - __
INTERP_ ๐REG_ INTERP_ HASHSET_ TO_ VECTOR - __
INTERP_ ๐REG_ INTERP_ HASHSET_ UNION - __
INTERP_ ๐REG_ INTERP_ HEAP - __
INTERP_ ๐REG_ INTERP_ HEAP_ PEEK - __
INTERP_ ๐REG_ INTERP_ HEAP_ POP - __
INTERP_ ๐REG_ INTERP_ HEAP_ PUSH - __
INTERP_ ๐REG_ INTERP_ HEAP_ SIZE
Functionsยง
- collection_
id ๐ - Extract a collection ID from an RValue (integer scalar, possibly with a class attribute).
- collection_
value ๐ - Build an integer scalar with a class attribute representing a collection.
- interp_
btreemap ๐ - Create an empty BTreeMap (ordered key-value store).
- interp_
btreemap_ ๐get - Look up a key in a BTreeMap, with an optional default.
- interp_
btreemap_ ๐has - Check whether a key exists in a BTreeMap.
- interp_
btreemap_ ๐keys - Return all keys of a BTreeMap as a sorted character vector.
- interp_
btreemap_ ๐remove - Remove a key from a BTreeMap, returning the old value.
- interp_
btreemap_ ๐set - Insert or update a key-value pair in a BTreeMap.
- interp_
btreemap_ ๐size - Return the number of key-value pairs in a BTreeMap.
- interp_
btreemap_ ๐to_ list - Convert a BTreeMap to a named R list (in key-sorted order).
- interp_
btreemap_ ๐values - Return all values of a BTreeMap as a list (in key-sorted order).
- interp_
deque ๐ - Create an empty deque (double-ended queue of R values).
- interp_
deque_ ๐pop_ back - Remove and return the last element of a deque.
- interp_
deque_ ๐pop_ front - Remove and return the first element of a deque.
- interp_
deque_ ๐push_ back - Append a value to the back of a deque.
- interp_
deque_ ๐push_ front - Prepend a value to the front of a deque.
- interp_
deque_ ๐size - Return the number of elements in a deque.
- interp_
deque_ ๐to_ list - Convert a deque to an R list.
- interp_
hashmap ๐ - Create an empty HashMap (unordered key-value store).
- interp_
hashmap_ ๐get - Look up a key in a HashMap, with an optional default.
- interp_
hashmap_ ๐has - Check whether a key exists in a HashMap.
- interp_
hashmap_ ๐keys - Return all keys of a HashMap as a character vector.
- interp_
hashmap_ ๐remove - Remove a key from a HashMap, returning the old value.
- interp_
hashmap_ ๐set - Insert or update a key-value pair in a HashMap.
- interp_
hashmap_ ๐size - Return the number of key-value pairs in a HashMap.
- interp_
hashmap_ ๐to_ list - Convert a HashMap to a named R list.
- interp_
hashmap_ ๐values - Return all values of a HashMap as a list.
- interp_
hashset ๐ - Create an empty HashSet (unordered unique-element set).
- interp_
hashset_ ๐add - Add a string element to a HashSet.
- interp_
hashset_ ๐diff - Compute the difference of two HashSets (s1 minus s2), returning a new HashSet.
- interp_
hashset_ ๐has - Check whether a string element is in a HashSet.
- interp_
hashset_ ๐intersect - Compute the intersection of two HashSets, returning a new HashSet.
- interp_
hashset_ ๐remove - Remove a string element from a HashSet.
- interp_
hashset_ ๐size - Return the number of elements in a HashSet.
- interp_
hashset_ ๐to_ vector - Convert a HashSet to a character vector.
- interp_
hashset_ ๐union - Compute the union of two HashSets, returning a new HashSet.
- interp_
heap ๐ - Create an empty max-heap (priority queue of numeric values).
- interp_
heap_ ๐peek - Peek at the maximum value in a max-heap without removing it.
- interp_
heap_ ๐pop - Pop and return the maximum value from a max-heap.
- interp_
heap_ ๐push - Push a numeric value onto a max-heap.
- interp_
heap_ ๐size - Return the number of elements in a max-heap.
- require_
string ๐ - Extract a string key from an argument at the given position.