pub struct TokioEngine;Expand description
Zero-sized marker for the tokio production engine. Default E on
crate::PulsarClient<E>.
Available behind the tokio feature (default-on).
Trait Implementations§
Source§impl Clone for TokioEngine
impl Clone for TokioEngine
Source§fn clone(&self) -> TokioEngine
fn clone(&self) -> TokioEngine
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for TokioEngine
Source§impl Debug for TokioEngine
impl Debug for TokioEngine
Source§impl Default for TokioEngine
impl Default for TokioEngine
Source§fn default() -> TokioEngine
fn default() -> TokioEngine
Returns the “default value” for a type. Read more
Source§impl Engine for TokioEngine
impl Engine for TokioEngine
Source§type ClientState = Client
type ClientState = Client
Per-engine state stored inside
crate::PulsarClient<E>. The tokio
engine plugs in magnetar_runtime_tokio::Client; the moonpool
engine plugs in (Arc<moonpool::ConnectionShared>, moonpool::DriverHandle). Both bundles are 'static + Send + Sync
so the façade can be moved across spawn boundaries unchanged.Source§type TaskHandle = JoinHandle<()>
type TaskHandle = JoinHandle<()>
Opaque, cancel-safe handle to a background task spawned via
Self::spawn. Dropping the handle aborts the task on the tokio
engine; explicit Self::abort_task is the happens-before-Drop
path the façade uses on shutdown.Source§type Interval = Interval
type Interval = Interval
Opaque periodic timer created via
Self::new_interval. The
façade drives ticks via Self::interval_tick.Source§fn name() -> &'static str
fn name() -> &'static str
Human-readable engine name, surfaced in logs / panics / errors.
Default returns the Rust type name — engines override to e.g.
"tokio" / "moonpool".Source§fn spawn<F>(fut: F) -> Self::TaskHandle
fn spawn<F>(fut: F) -> Self::TaskHandle
Spawn an async future on the engine’s executor. Returns a cancel-
safe
Self::TaskHandle. Tokio wraps ::tokio::spawn; moonpool
delegates through its Providers::TaskProvider (moonpool_core).Source§fn abort_task(handle: &mut Self::TaskHandle)
fn abort_task(handle: &mut Self::TaskHandle)
Abort a spawned task. Idempotent: calling on an already-completed
or already-aborted handle is a no-op.
Source§fn new_interval(period: Duration) -> Self::Interval
fn new_interval(period: Duration) -> Self::Interval
Create a periodic timer with
period between ticks. The first
tick fires immediately (matches tokio::time::interval).Source§fn interval_tick<'a>(
interval: &'a mut Self::Interval,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'a>>
fn interval_tick<'a>( interval: &'a mut Self::Interval, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'a>>
Await the next tick. The returned future is
Send and boxed so
the caller can .await from a generic context without exposing
the engine-specific timer shape.Source§fn random_subscription_suffix() -> String
fn random_subscription_suffix() -> String
Engine-injected id provider for the façade’s auto-generated
subscription names (
Reader, TableView) and for the opt-in
ProducerBuilder::unique_name_suffix
policy (issue #406). Tokio plugs in
Uuid::new_v4().simple() (RFC 4122 random); moonpool plugs in
a process-global atomic counter so deterministic-simulation runs
produce stable, reproducible names. Callers that need fully
deterministic names across processes should always pass an
explicit subscription / reader / producer name through the builder and
leave the suffix policy off.Source§impl MessageDecryptorApi for TokioEngine
impl MessageDecryptorApi for TokioEngine
Source§type Decryptor = Arc<dyn MessageDecryptor>
type Decryptor = Arc<dyn MessageDecryptor>
Concrete per-engine decryptor type.
Clone + Send + Sync + 'static.Source§impl MessageEncryptorApi for TokioEngine
impl MessageEncryptorApi for TokioEngine
Source§type Encryptor = Arc<dyn MessageEncryptor>
type Encryptor = Arc<dyn MessageEncryptor>
Concrete per-engine encryptor type.
Clone + Send + Sync + 'static
so it survives spawn boundaries and fan-out into child producers.Auto Trait Implementations§
impl Freeze for TokioEngine
impl RefUnwindSafe for TokioEngine
impl Send for TokioEngine
impl Sync for TokioEngine
impl Unpin for TokioEngine
impl UnsafeUnpin for TokioEngine
impl UnwindSafe for TokioEngine
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