pub enum MaxFrequency {
Unlimited,
Unfiltered,
Limited(FrequencyLimit),
}Expand description
A ceiling on how often the server may send updates for an item
[docs/spec/03-requests.md §6.1].
Frequency limiting happens on the server, before the data is sent, so
it is the effective way to protect a slow consumer: this crate never drops
an update it has received (see Updates).
Variants§
Unlimited
No limit: each update is sent as soon as possible. The server’s default.
Unfiltered
No limit and no losses: the server never merges or discards an
update to keep up. If it cannot, it says so with an overflow
notification rather than dropping silently
[docs/spec/04-notifications.md §3]. Not compatible with a buffer size
request, which the server ignores in this case.
Limited(FrequencyLimit)
At most this many updates per second, per item.
Implementations§
Source§impl MaxFrequency
impl MaxFrequency
Sourcepub fn limited(
updates_per_second: impl Into<String>,
) -> Result<Self, ConfigError>
pub fn limited( updates_per_second: impl Into<String>, ) -> Result<Self, ConfigError>
A ceiling in updates per second, written as a decimal number.
§Errors
ConfigError::InvalidFrequency if the text is not a plain decimal
number with a dot separator — 2, 0.5 and 12.75 are accepted; a
sign, an exponent, a comma separator and a bare .5 are not.
§Examples
use lightstreamer_rs::{ConfigError, MaxFrequency};
let twice_a_second = MaxFrequency::limited("2.0")?;
assert!(matches!(MaxFrequency::limited("2,0"), Err(ConfigError::InvalidFrequency { .. })));Trait Implementations§
Source§impl Clone for MaxFrequency
impl Clone for MaxFrequency
Source§fn clone(&self) -> MaxFrequency
fn clone(&self) -> MaxFrequency
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more