pub struct PythonPluginHandle { /* private fields */ }Expand description
Loaded-and-validated handle to one Python plugin.
Implementations§
Source§impl PythonPluginHandle
impl PythonPluginHandle
pub fn descriptor(&self) -> &'static PythonInterfaceDescriptor
pub fn method_count(&self) -> usize
Sourcepub fn call_typed(
&self,
method_index: usize,
input_bincode: &[u8],
) -> Result<Vec<u8>, PythonCallError>
pub fn call_typed( &self, method_index: usize, input_bincode: &[u8], ) -> Result<Vec<u8>, PythonCallError>
Typed dispatch.
input_bincode is the bincode-encoded args tuple — the same byte
payload the cdylib path would receive. We use bincode here only
because every other fidius caller does; on the way into Python we
pivot through serde_json::Value (so the host’s I: Serialize works
for any type the macro accepts).
Sourcepub fn call_typed_json(
&self,
method_index: usize,
input_json: &[u8],
) -> Result<Vec<u8>, PythonCallError>
pub fn call_typed_json( &self, method_index: usize, input_json: &[u8], ) -> Result<Vec<u8>, PythonCallError>
Typed dispatch where the input is already JSON-serialised (the
host’s serde_json::to_vec(&input)). Returns JSON bytes the caller
serde_json::from_slice::<O> decodes.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PythonPluginHandle
impl !RefUnwindSafe for PythonPluginHandle
impl Send for PythonPluginHandle
impl Sync for PythonPluginHandle
impl Unpin for PythonPluginHandle
impl UnsafeUnpin for PythonPluginHandle
impl UnwindSafe for PythonPluginHandle
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