Skip to main content

Module value

Module value 

Source

Structs§

HashMap
A hash table where the iteration order of the key-value pairs is independent of the hash values of the keys.

Enums§

Value
A dynamic value type that mirrors the CCXT JavaScript Value semantics.

Functions§

book_fields_as_value
Expand a shared book Dict into a plain Dict carrying its meta fields (for serialization / equality). Strips __book_id so the result is inert.
cache_entries_as_value
Snapshot a WS cache’s rolling buffer as a plain array. Handles both the _data-backed ArrayCache / ArrayCacheByTimestamp (trades, ohlcv, tickers) and the registry-backed order-book cache handle. Returns None when v isn’t a cache — to_array then falls back to its generic Dict handling. Without this, to_array(cache) would surface the cache’s meta fields (__cacheKind, counters, boolean flags) as if they were entries.
deep_extend
Recursively merges src into dst. For map/map overlaps the source fields win (deep extend).
get_value
Access a value in a map by string key, or array by integer key encoded as a Value::Str / Value::Int. Returns Value::Null on miss.
get_value_k
Hot-path get_value variant that takes the key as a &str directly, skipping a Value::Str heap allocation. Used by the safe_*_k fast-path readers the transpiler routes literal-key calls through.
safe_bool
safe_integer
safe_number
safe_string
set_live_lookup
set_live_set_markets
set_value
Set a key/index in a map or array value.
side_entries_as_value
Public: snapshot a side marker’s entries as a Value array, or None when v is not a side marker. Entries live in the shared side store (not the Dict), so callers that need the raw [[price, size, …], …] list — test helpers, serializers — go through this.
side_price_amounts
Read a side marker’s levels as [price, amount] pairs straight from the shared side store — no intermediate Value list is materialised, so the typed OrderBook::from_value decode reads the book without cloning every level. Returns None when v is not a side marker (the caller then reads a plain Value::Arr). NaN/short rows are dropped (not valid book levels).