Struct libstrophe::Context
source · pub struct Context<'cb, 'cn> { /* private fields */ }
Expand description
Proxy to the underlying xmpp_ctx_t
struct.
Most of the methods in this struct mimic the methods of the underlying library. So please see libstrophe docs for context and event loop plus ctx.c and event.c sources. Only where it’s not the case or there is some additional logic involved then you can see the method description.
This struct implements:
Drop
(xmpp_ctx_free).Eq
by comparing internal pointersSend
Implementations§
source§impl<'cb, 'cn> Context<'cb, 'cn>
impl<'cb, 'cn> Context<'cb, 'cn>
sourcepub fn new_with_default_logger() -> Context<'static, 'cn>
pub fn new_with_default_logger() -> Context<'static, 'cn>
Shortcut to return a new context with default logger.
Equivalent to passing default logger to Context
constructor.
sourcepub fn new_with_null_logger() -> Context<'static, 'cn>
pub fn new_with_null_logger() -> Context<'static, 'cn>
Shortcut to return a new context with null logger.
Equivalent to passing null logger to Context
constructor.
sourcepub unsafe fn from_ref(inner: *const xmpp_ctx_t) -> Self
pub unsafe fn from_ref(inner: *const xmpp_ctx_t) -> Self
Safety
inner must be a valid pointer to a previously allocated xmp_ctx_t and you must make sure that Self doesn’t outlive the context behind that pointer
sourcepub unsafe fn from_ref_mut(inner: *mut xmpp_ctx_t) -> Self
pub unsafe fn from_ref_mut(inner: *mut xmpp_ctx_t) -> Self
Safety
inner must be a valid pointer to a previously allocated mutable xmp_ctx_t and you must make sure that Self doesn’t outlive the context behind that pointer
sourcepub fn set_timeout(&mut self, timeout: Duration)
pub fn set_timeout(&mut self, timeout: Duration)
Default timeout is 1000ms