Struct ockam_node::Executor
source · pub struct Executor { /* private fields */ }
Expand description
Underlying Ockam node executor
This type is a small wrapper around an inner async runtime (tokio
by
default) and the Ockam router. In most cases it is recommended you use the
ockam::node
function annotation instead!
Implementations§
source§impl Executor
impl Executor
sourcepub fn new(flow_controls: &FlowControls) -> Self
pub fn new(flow_controls: &FlowControls) -> Self
Create a new Ockam node Executor
instance
sourcepub async fn start_router(&mut self) -> Result<()>
pub async fn start_router(&mut self) -> Result<()>
Start the router asynchronously
sourcepub fn execute<F, T>(&mut self, future: F) -> Result<F::Output>where
F: Future<Output = Result<T>> + Send + 'static,
T: Send + 'static,
pub fn execute<F, T>(&mut self, future: F) -> Result<F::Output>where F: Future<Output = Result<T>> + Send + 'static, T: Send + 'static,
Initialise and run the Ockam node executor context
In this background this launches async execution of the Ockam router, while blocking execution on the provided future.
Any errors encountered by the router or provided application code will be returned from this function.
Auto Trait Implementations§
impl !RefUnwindSafe for Executor
impl Send for Executor
impl Sync for Executor
impl Unpin for Executor
impl !UnwindSafe for Executor
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