Skip to main content

EventDomainDriver

Trait EventDomainDriver 

Source
pub trait EventDomainDriver:
    Debug
    + Send
    + Sync
    + 'static {
    // Required method
    fn begin_run(
        &self,
        domain: EventDomainId,
    ) -> Result<Box<dyn EventDomainRun>>;

    // Provided method
    fn supports_scoped_read_only(&self) -> bool { ... }
}
Expand description

Runtime-owned factory for per-execution event-domain state.

§Examples

use tenferro_runtime::{EventDomainDriver, EventDomainId};

fn begin(
    driver: &dyn EventDomainDriver,
    domain: EventDomainId,
) -> tenferro_runtime::Result<()> {
    let mut run = driver.begin_run(domain)?;
    run.drain()
}

Required Methods§

Source

fn begin_run(&self, domain: EventDomainId) -> Result<Box<dyn EventDomainRun>>

Begin one isolated execution run for exactly domain.

§Errors

Returns a driver-defined typed error, such as crate::Error::Internal, when native queue, stream, or per-run event-state allocation fails, or when the domain cannot admit a new run.

Provided Methods§

Source

fn supports_scoped_read_only(&self) -> bool

Report whether this provider proves retirement before a scoped call returns.

The default is conservative: asynchronous queues and providers with unknown retirement semantics cannot admit borrowed scoped inputs.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§