nash-io / openlimits

A Rust high performance cryptocurrency trading API with support for multiple exchanges and language wrappers.
http://openlimits.io
BSD 2-Clause "Simplified" License
275 stars 44 forks source link

Enum that implements traits for any supported exchange type #109

Closed Ejhfast closed 3 years ago

Ejhfast commented 3 years ago

In some contexts, such as bindings in other languages (e.g., Python via pyo3), it is not possible to use generics like fn init<T: Exchange>(){ ... }. This makes it difficult to write general logic that can operate over dynamically instantiated exchange types. This module provides an enum wrapper type that code can use in these cases