Skip to main content

LimitPolicy

Trait LimitPolicy 

Source
pub trait LimitPolicy {
    // Required methods
    fn allowed_markets(&self) -> Option<&HashSet<String>>;
    fn allowed_symbols(&self) -> Option<&HashSet<String>>;
    fn max_order_value(&self) -> Option<f64>;
    fn max_daily_value(&self) -> Option<f64>;
    fn hours_window(&self) -> Option<&str>;
    fn max_orders_per_minute(&self) -> Option<u32>;
    fn allowed_trd_sides(&self) -> Option<&HashSet<String>>;
    fn allowed_acc_ids(&self) -> Option<&HashSet<u64>>;
    fn allowed_card_nums(&self) -> Option<&[String]>;
}
Expand description

Borrowed view of the effective per-key limit policy.

Runtime checks accept this trait so a crate::KeyRecord can expose its configured sets directly instead of allocating an owned Limits clone on every authenticated request. The owned type remains part of the public API for configuration and compatibility callers.

Required Methods§

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§