#[repr(C)]pub struct NrPluginVTable {
pub init: Option<unsafe extern "C" fn(host_ctx: *mut c_void, host_vtable: *const NrHostVTable) -> NrStatus>,
pub handle: Option<unsafe extern "C" fn(entry: NrStr, sid: u64, payload: NrBytes) -> NrStatus>,
pub shutdown: Option<unsafe extern "C" fn()>,
pub stream_data: Option<unsafe extern "C" fn(sid: u64, data: NrBytes) -> NrStatus>,
pub stream_close: Option<unsafe extern "C" fn(sid: u64) -> NrStatus>,
pub resolve_entry: Option<unsafe extern "C" fn(entry: NrStr) -> u32>,
pub handle_by_id: Option<unsafe extern "C" fn(id: u32, sid: u64, payload: NrBytes) -> NrStatus>,
}Expand description
Plugin function table.
Fields§
§init: Option<unsafe extern "C" fn(host_ctx: *mut c_void, host_vtable: *const NrHostVTable) -> NrStatus>§handle: Option<unsafe extern "C" fn(entry: NrStr, sid: u64, payload: NrBytes) -> NrStatus>§shutdown: Option<unsafe extern "C" fn()>§stream_data: Option<unsafe extern "C" fn(sid: u64, data: NrBytes) -> NrStatus>§stream_close: Option<unsafe extern "C" fn(sid: u64) -> NrStatus>§resolve_entry: Option<unsafe extern "C" fn(entry: NrStr) -> u32>Maps an entry name to a stable dispatch id, or NR_ENTRY_UNKNOWN.
The id stays valid for the lifetime of the loaded plugin instance;
hosts resolve once and then call through handle_by_id, skipping
the per-call name comparison.
handle_by_id: Option<unsafe extern "C" fn(id: u32, sid: u64, payload: NrBytes) -> NrStatus>Dispatches by an id from resolve_entry; an id the plugin never
issued reports Invalid. Both fields must be present together.
Trait Implementations§
Source§impl Clone for NrPluginVTable
impl Clone for NrPluginVTable
Source§fn clone(&self) -> NrPluginVTable
fn clone(&self) -> NrPluginVTable
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for NrPluginVTable
Source§impl Debug for NrPluginVTable
impl Debug for NrPluginVTable
impl Send for NrPluginVTable
impl Sync for NrPluginVTable
Auto Trait Implementations§
impl Freeze for NrPluginVTable
impl RefUnwindSafe for NrPluginVTable
impl Unpin for NrPluginVTable
impl UnsafeUnpin for NrPluginVTable
impl UnwindSafe for NrPluginVTable
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