pub enum Permission {
Operator,
Trader,
Custodian,
ReadOnly,
Replication,
}Expand description
Permission level assigned to an authenticated connection.
Five specialized roles with no overlap — separation of duties: Operator: exchange configuration (instruments, risk, circuit breakers) Trader: order submission and cancellation Custodian: fund management (deposit/withdraw) ReadOnly: observation only (heartbeats, future market data) Replication: journal streaming between primary and replica servers
No single role has full access. An organization needing both trading and admin uses separate keys for each role.
Checked on the reader thread (cold per-request check) with zero cost on the matching engine hot path.
Variants§
Operator
Exchange configuration: instrument management, circuit breakers, risk limits, fee schedules, end-of-day, stats. Cannot trade or manage funds.
Trader
Submit/cancel orders and heartbeats. Cannot perform admin ops or fund management (deposit/withdraw).
Custodian
Deposit and withdraw only. Cannot trade or perform admin ops. Separates fund management from trading and exchange administration.
ReadOnly
Heartbeats only. Future: market data subscriptions.
Replication
Replication only. Authorizes a replica to connect and receive journal streams. Cannot trade, manage funds, or configure the exchange. Infrastructure role, not client-facing.
Implementations§
Source§impl Permission
impl Permission
Sourcepub fn can_trade(self) -> bool
pub fn can_trade(self) -> bool
Whether this permission level allows trading operations (submit order, cancel order, cancel all, cancel-replace).
Sourcepub fn is_operator(self) -> bool
pub fn is_operator(self) -> bool
Whether this permission level allows administrative operations (add instrument, set risk limits, circuit breakers, fee schedules, end-of-day, query stats).
Sourcepub fn can_manage_funds(self) -> bool
pub fn can_manage_funds(self) -> bool
Whether this permission level allows fund management operations (deposit, withdraw).
Sourcepub fn is_replication(self) -> bool
pub fn is_replication(self) -> bool
Whether this permission level authorizes replication connections (journal streaming between primary and replica).
Trait Implementations§
Source§impl Clone for Permission
impl Clone for Permission
Source§fn clone(&self) -> Permission
fn clone(&self) -> Permission
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more