Trait PkMethodAccessor

Source
pub trait PkMethodAccessor {
    // Required method
    fn call(
        &self,
        key: String,
        param: Vec<u8>,
    ) -> Result<Pin<Box<dyn Pollable>>, String>;
}
Expand description

Trait defining how to invoke methods by their string key.

This allows the PkCommand state machine to be generic over the actual method implementation.

Required Methods§

Source

fn call( &self, key: String, param: Vec<u8>, ) -> Result<Pin<Box<dyn Pollable>>, String>

Calls a method with the given parameters.

§Arguments
  • key: The name of the method to call.
  • param: The parameters for the method, as a byte vector.
§Returns

A Result containing a pinned, boxed Pollable that will resolve to the method’s output (Result<Option<Vec<u8>>, String>), or an Err(String) if the method call cannot be initiated.

Implementors§