pub struct Client { /* private fields */ }Expand description
Creates channels. It holds configuration only and does no network work. It is cheap to clone.
Implementations§
Source§impl Client
impl Client
Sourcepub fn new(options: ClientOptions) -> Result<Client, CelerisError>
pub fn new(options: ClientOptions) -> Result<Client, CelerisError>
Validates options and returns a client. It fails with
CelerisError::Configuration, which names every field that failed
and its rule: a timeout outside 1 ms to 15 minutes, a size of zero, a
maximum reconnect attempts outside 1 to 100, or a base URL that is not
wss://, or ws:// for a loopback host when allowed.
Sourcepub fn channel(&self, reference: &str) -> Result<Channel, CelerisError>
pub fn channel(&self, reference: &str) -> Result<Channel, CelerisError>
A handle for the channel with the given reference. It does no network
work; each call returns a new channel with its own connection. It fails
with CelerisError::Configuration unless the reference is 1 to 255
ASCII letters, digits, hyphens or underscores.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Client
impl !UnwindSafe for Client
impl Freeze for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnsafeUnpin for Client
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