pub struct SequenceName(/* private fields */);Expand description
The name of an ordered message sequence
[docs/spec/03-requests.md §12.1].
Messages sharing a sequence are delivered to the Metadata Adapter in order of their progressive number, and a message in no sequence is processed as soon as it arrives, possibly alongside others. A sequence is therefore how an application says “these messages must not overtake each other”.
§Examples
use lightstreamer_rs::SequenceName as Sequence;
let orders = Sequence::try_new("ORDERS")?;
assert_eq!(orders.as_str(), "ORDERS");Implementations§
Source§impl SequenceName
impl SequenceName
Sourcepub fn try_new(name: impl Into<String>) -> Result<Self, ConfigError>
pub fn try_new(name: impl Into<String>) -> Result<Self, ConfigError>
Checks and wraps a sequence name.
§Errors
ConfigError::InvalidSequenceName if the name is empty, contains
anything but ASCII letters, digits and underscores, or is
UNORDERED_MESSAGES — which earlier versions of the protocol used and
which this one reserves, so the server would refuse it
[docs/spec/03-requests.md §12.1].
§Examples
use lightstreamer_rs::{ConfigError, SequenceName as Sequence};
assert!(matches!(
Sequence::try_new("UNORDERED_MESSAGES"),
Err(ConfigError::InvalidSequenceName { .. })
));Trait Implementations§
Source§impl Clone for SequenceName
impl Clone for SequenceName
Source§fn clone(&self) -> SequenceName
fn clone(&self) -> SequenceName
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SequenceName
impl Debug for SequenceName
impl Eq for SequenceName
Source§impl Hash for SequenceName
impl Hash for SequenceName
Source§impl Ord for SequenceName
impl Ord for SequenceName
Source§fn cmp(&self, other: &SequenceName) -> Ordering
fn cmp(&self, other: &SequenceName) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for SequenceName
impl PartialEq for SequenceName
Source§impl PartialOrd for SequenceName
impl PartialOrd for SequenceName
impl StructuralPartialEq for SequenceName
Auto Trait Implementations§
impl Freeze for SequenceName
impl RefUnwindSafe for SequenceName
impl Send for SequenceName
impl Sync for SequenceName
impl Unpin for SequenceName
impl UnsafeUnpin for SequenceName
impl UnwindSafe for SequenceName
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