run

Function run 

Source
pub fn run<F, E>(fut: F) -> ManagedFuture
where F: Future<Output = Result<(), E>> + Send + 'static, E: Into<BoxError> + 'static,
Expand description

Boxes a future without spawning a separate managed task

Use this in [ManagedProc::start_task] impls when you want to run the future directly rather than spawning it. Prefer spawn when possible, as spawned tasks can run more efficiently on the Tokio runtime

§Example

impl ManagedProc for MyLocalDaemon {
    fn start_task(self: Box<Self>, shutdown: ShutdownSignal) -> ManagedFuture {
        super_visor::run(self.run(shutdown))
    }
}