pub struct AdapterSet(/* private fields */);Expand description
The name of the Adapter Set that will serve a session.
A Lightstreamer server hosts one or more Adapter Sets — a Metadata
Adapter plus the Data Adapters it fronts. The name selects which one this
session talks to; the server assumes an Adapter Set named DEFAULT when
none is given [docs/spec/03-requests.md §2.1].
The public demo server used by the specification’s own transcripts serves
an Adapter Set named DEMO [docs/spec/02-session-lifecycle.md §10].
§Examples
use lightstreamer_rs::AdapterSet;
let adapters = AdapterSet::try_new("DEMO")?;
assert_eq!(adapters.as_str(), "DEMO");Implementations§
Source§impl AdapterSet
impl AdapterSet
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 an Adapter Set name.
§Errors
ConfigError::EmptyAdapterSetif the name is empty or only whitespace. Omitting the Adapter Set entirely and naming it the empty string are different requests, and the second is never what a caller means; to get the server’sDEFAULT, leave the name unset.ConfigError::AdapterSetControlCharacterif the name contains an ASCII control character. This is a guard of this crate, not a protocol rule: the specification gives no grammar for the name, and the request encoder would percent-escape a strayCRfaithfully — but a control character in a logical adapter name is a mistake in every case, and failing here beats a server-side rejection.
Trait Implementations§
Source§impl Clone for AdapterSet
impl Clone for AdapterSet
Source§fn clone(&self) -> AdapterSet
fn clone(&self) -> AdapterSet
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 AdapterSet
impl Debug for AdapterSet
Source§impl Display for AdapterSet
impl Display for AdapterSet
impl Eq for AdapterSet
Source§impl Hash for AdapterSet
impl Hash for AdapterSet
Source§impl Ord for AdapterSet
impl Ord for AdapterSet
Source§fn cmp(&self, other: &AdapterSet) -> Ordering
fn cmp(&self, other: &AdapterSet) -> 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 AdapterSet
impl PartialEq for AdapterSet
Source§impl PartialOrd for AdapterSet
impl PartialOrd for AdapterSet
impl StructuralPartialEq for AdapterSet
Auto Trait Implementations§
impl Freeze for AdapterSet
impl RefUnwindSafe for AdapterSet
impl Send for AdapterSet
impl Sync for AdapterSet
impl Unpin for AdapterSet
impl UnsafeUnpin for AdapterSet
impl UnwindSafe for AdapterSet
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