Skip to main content

AimDbRunner

Struct AimDbRunner 

Source
pub struct AimDbRunner { /* private fields */ }
Expand description

Non-Clone runner returned alongside AimDb from AimDbBuilder::build().

Owns the complete set of futures that drive the database (producer services, consumer taps, transforms with fan-in forwarders, connectors, remote-access supervisor, on_start tasks). run() consumes self, drives every future cooperatively via a FuturesUnordered, and returns only when every future has completed — typically never, since producer/consumer loops run for the application’s lifetime.

Cancellation is the application’s responsibility — wrap runner.run() in tokio::select! with a shutdown signal, or use a CancellationToken inside each registered service.

Implementations§

Source§

impl AimDbRunner

Source

pub fn future_count(&self) -> usize

Returns the number of futures the runner will drive. Useful for tests and diagnostic logging.

Source

pub async fn run(self)

Drives every collected future to completion.

Returns when all futures complete (normally: never, while producer and consumer loops are alive). To cancel, wrap this call in tokio::select! (or the analogous primitive on Embassy / WASM) with a shutdown signal — when the select! arm fires, this future is dropped and every FuturesUnordered entry is cancelled with it.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.