polyoxide-venue
The vocabulary every polyoxide crate shares: the eight error classes, the
Classify trait every public error type implements, the status and close-code
maps, the one Retry-After parser, Secret, the wire_enum! and open_enum!
macros with their UnknownVariant, UnixMillis, and, behind the decimal
feature, the positional decimal serde of rows sent as bare arrays.
Behind the keys feature, MarketKey names one instrument as
venue.product:id, canonical because only a product's KeySpace makes one.
Each product declares its ProductClass, event contract, perpetual future or
spot, and every key it makes carries it.
Behind the market feature, the market-data traits (MarketData, which every
venue product implements, and the capability traits Instruments, Trades,
Candles, Funding and EventGroups, each with a Dyn wrapper) return the
shared records, each carrying a venue's own facts in its Extensions. The
class bundles PerpetualMarket, EventContractMarket and SpotMarket name
what every product of a class offers, so a function generic over one class
needs one bound.
Behind the trading feature, Trading places and cancels orders, reads open
orders, positions and balances, and streams acknowledgements and fills as
TradingEvents, which begins with a Resync; Extensions::ensure_declared is
how a venue refuses an option it does not declare.
By default it depends on nothing (on wasm32 it depends only on web-time, which
reads the browser's wall clock), so a credential-free socket client can use it
without building an HTTP or signing stack.
More information about this crate can be found in the crate documentation.
Installation
[]
= "0.48"
Usage
One retry policy serves every polyoxide error, whichever crate it came from:
use Duration;
use ;
;
assert_eq!;
A caller that handles errors from several crates at once can convert each into
a ClassifiedError with ?, which keeps the class, whether the error is a
fault, and the wait it asked for.