pub struct ConnQuota {
pub max_conns: usize,
pub max_subs_per_conn: usize,
pub supports_multiplex: bool,
}Expand description
Connection and subscription quotas of one broker user.
BrokerLimiter only stores and returns these numbers (see BrokerLimiter::conn_quota).
It does not open or close connections. A connector decides what to do with them. For example
the Finam connector reads max_subs_per_conn and refuses a new stream with
[brokapi_core::Error::Rejected] once the quota is used. The other fields are carried for the
connectors that need them and are not enforced by the runtime.
§Examples
use brokapi_runtime::ConnQuota;
let q = ConnQuota::default();
assert_eq!((q.max_conns, q.max_subs_per_conn), (2, 50));
assert!(!q.supports_multiplex);Fields§
§max_conns: usizeHow many connections the broker lets one user hold at the same time.
max_subs_per_conn: usizeHow many subscriptions (streams) one connection may carry.
supports_multiplex: boolWhether one connection can carry several subscriptions at once.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ConnQuota
impl<'de> Deserialize<'de> for ConnQuota
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for ConnQuota
Auto Trait Implementations§
impl Freeze for ConnQuota
impl RefUnwindSafe for ConnQuota
impl Send for ConnQuota
impl Sync for ConnQuota
impl Unpin for ConnQuota
impl UnsafeUnpin for ConnQuota
impl UnwindSafe for ConnQuota
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more