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<'session, H, V, U, P, M, E>( &self, host_name: H, vpn_name: V, username: U, password: P, on_message: Option<M>, on_event: Option<E> ) -> Result<Session<'session>, SessionError>
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