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.
Important: Only initialize one context per application as it initializes global variables upon creation. 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>, SessionBuilderError>
Trait Implementations§
Auto Trait Implementations§
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