pub struct Context { /* private fields */ }
Expand description
Handle for a Solace context, used to create sessions.
It is thread safe, and can be safely cloned and shared. Each clone
references the same underlying C context. Internally, an Arc
is
used to implement this in a threadsafe way.
Also note that this binding deviates from the C API in that each session created from a context initially owns a clone of that context.
Implementations§
Source§impl Context
impl Context
pub fn new(log_level: SolaceLogLevel) -> Result<Self, ContextError>
pub fn session_builder<Host, Vpn, Username, Password, OnMessage, OnEvent>( &self, ) -> SessionBuilder<Host, Vpn, Username, Password, OnMessage, OnEvent>
pub fn session<'session, Host, Vpn, Username, Password, OnMessage, OnEvent>( &self, host_name: Host, vpn_name: Vpn, username: Username, password: Password, on_message: Option<OnMessage>, on_event: Option<OnEvent>, ) -> Result<Session<'session, OnMessage, OnEvent>, SessionBuilderError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Context
impl RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnwindSafe for Context
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