pub struct SessionWrapper<T> {
pub handle: *mut PluginSession,
/* private fields */
}Expand description
A wrapper for a Janus session. Contains a pointer to the Janus PluginSession (which is used to identify
this session in the Janus FFI) and any Rust state associated with the session.
Fields§
§handle: *mut PluginSessionImplementations§
Source§impl<T> SessionWrapper<T>
impl<T> SessionWrapper<T>
Sourcepub unsafe fn associate(
handle: *mut PluginSession,
state: T,
) -> Result<Box<Arc<Self>>, NullHandleError>
pub unsafe fn associate( handle: *mut PluginSession, state: T, ) -> Result<Box<Arc<Self>>, NullHandleError>
Allocates a boxed, reference-counted state wrapper associated with a Janus PluginSession (whose plugin_handle will then point to the contents of the box).
Sourcepub unsafe fn from_ptr(
handle: *mut PluginSession,
) -> Result<Arc<Self>, NullHandleError>
pub unsafe fn from_ptr( handle: *mut PluginSession, ) -> Result<Arc<Self>, NullHandleError>
Retrieves and clones the reference-counted state wrapper associated with a Janus PluginSession.
Sourcepub fn as_ptr(&self) -> *mut PluginSession
pub fn as_ptr(&self) -> *mut PluginSession
Returns the opaque pointer for this session.
Trait Implementations§
Source§impl<T: Clone> Clone for SessionWrapper<T>
impl<T: Clone> Clone for SessionWrapper<T>
Source§fn clone(&self) -> SessionWrapper<T>
fn clone(&self) -> SessionWrapper<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Debug> Debug for SessionWrapper<T>
impl<T: Debug> Debug for SessionWrapper<T>
Source§impl<T> Deref for SessionWrapper<T>
impl<T> Deref for SessionWrapper<T>
Source§impl<T> Drop for SessionWrapper<T>
impl<T> Drop for SessionWrapper<T>
Source§impl<T> Hash for SessionWrapper<T>
impl<T> Hash for SessionWrapper<T>
Source§impl<T> PartialEq for SessionWrapper<T>
impl<T> PartialEq for SessionWrapper<T>
impl<T> Eq for SessionWrapper<T>
impl<T: Send> Send for SessionWrapper<T>
impl<T: Sync> Sync for SessionWrapper<T>
Auto Trait Implementations§
impl<T> Freeze for SessionWrapper<T>where
T: Freeze,
impl<T> RefUnwindSafe for SessionWrapper<T>where
T: RefUnwindSafe,
impl<T> Unpin for SessionWrapper<T>where
T: Unpin,
impl<T> UnwindSafe for SessionWrapper<T>where
T: UnwindSafe,
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