[][src]Struct janus_plugin::session::SessionWrapper

pub struct SessionWrapper<T> {
    pub handle: *mut PluginSession,
    // some fields omitted
}

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 PluginSession

Methods

impl<T> SessionWrapper<T>[src]

pub unsafe fn associate(
    handle: *mut PluginSession,
    state: T
) -> Result<Box<Arc<Self>>, NullHandleError>
[src]

Allocates a boxed, reference-counted state wrapper associated with a Janus PluginSession (whose plugin_handle will then point to the contents of the box).

pub unsafe fn from_ptr(
    handle: *mut PluginSession
) -> Result<Arc<Self>, NullHandleError>
[src]

Retrieves and clones the reference-counted state wrapper associated with a Janus PluginSession.

pub fn as_ptr(&self) -> *mut PluginSession[src]

Returns the opaque pointer for this session.

Trait Implementations

impl<T: Clone> Clone for SessionWrapper<T>[src]

impl<T: Debug> Debug for SessionWrapper<T>[src]

impl<T> Deref for SessionWrapper<T>[src]

type Target = T

The resulting type after dereferencing.

impl<T> Drop for SessionWrapper<T>[src]

impl<T> Eq for SessionWrapper<T>[src]

impl<T> Hash for SessionWrapper<T>[src]

impl<T> PartialEq<SessionWrapper<T>> for SessionWrapper<T>[src]

impl<T: Send> Send for SessionWrapper<T>[src]

impl<T: Sync> Sync for SessionWrapper<T>[src]

Auto Trait Implementations

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.