pub struct PluginResult { /* private fields */ }
Expand description
A Janus plugin result; what a plugin returns to the gateway as a direct response to a signalling message.
Implementations§
Source§impl PluginResult
impl PluginResult
Sourcepub unsafe fn new(
type_: PluginResultType,
text: *const c_char,
content: *mut RawJanssonValue,
) -> Self
pub unsafe fn new( type_: PluginResultType, text: *const c_char, content: *mut RawJanssonValue, ) -> Self
Creates a new plugin result.
Sourcepub fn ok(response: JanssonValue) -> Self
pub fn ok(response: JanssonValue) -> Self
Creates a plugin result indicating a synchronously successful request. The provided response JSON will be passed back to the client.
Sourcepub fn ok_wait(hint: Option<&'static CStr>) -> Self
pub fn ok_wait(hint: Option<&'static CStr>) -> Self
Creates a plugin result indicating an asynchronous request in progress. If provided, the hint text will be synchronously passed back to the client in the acknowledgement.
Sourcepub fn error(msg: &'static CStr) -> Self
pub fn error(msg: &'static CStr) -> Self
Creates a plugin result indicating an error. The provided error text will be synchronously passed back to the client.
Sourcepub fn into_raw(self) -> *mut RawPluginResult
pub fn into_raw(self) -> *mut RawPluginResult
Transfers ownership of this result to the wrapped raw pointer. The consumer is responsible for calling
janus_plugin_result_destroy
on the pointer when finished.
Trait Implementations§
Source§impl Debug for PluginResult
impl Debug for PluginResult
Source§impl Deref for PluginResult
impl Deref for PluginResult
Source§type Target = janus_plugin_result
type Target = janus_plugin_result
The resulting type after dereferencing.
Source§fn deref(&self) -> &RawPluginResult
fn deref(&self) -> &RawPluginResult
Dereferences the value.
Source§impl Drop for PluginResult
impl Drop for PluginResult
impl Send for PluginResult
Auto Trait Implementations§
impl Freeze for PluginResult
impl RefUnwindSafe for PluginResult
impl !Sync for PluginResult
impl Unpin for PluginResult
impl UnwindSafe for PluginResult
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