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.
Sourcepub fn call_streaming_start(
&self,
method_index: usize,
input_json: &[u8],
) -> Result<PythonStream, PythonCallError>
pub fn call_streaming_start( &self, method_index: usize, input_json: &[u8], ) -> Result<PythonStream, PythonCallError>
Start a server-streaming call (FIDIUS-I-0026). Calls the method to obtain
its iterator/generator and wraps it in a crate::stream::PythonStream
the host then pumps. Input is JSON like Self::call_typed_json;
streaming methods use the typed (non-raw) path.