Skip to main content

TokioEngine

Struct TokioEngine 

Source
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

Source§

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)

Performs copy-assignment from source. Read more
Source§

impl Copy for TokioEngine

Source§

impl Debug for TokioEngine

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TokioEngine

Source§

fn default() -> TokioEngine

Returns the “default value” for a type. Read more
Source§

impl Engine for TokioEngine

Source§

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<()>

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

Opaque periodic timer created via Self::new_interval. The façade drives ticks via Self::interval_tick.
Source§

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
where F: Future<Output = ()> + Send + 'static,

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)

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

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>>

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

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

Source§

type Decryptor = Arc<dyn MessageDecryptor>

Concrete per-engine decryptor type. Clone + Send + Sync + 'static.
Source§

impl MessageEncryptorApi for TokioEngine

Source§

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§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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, <T as TryFrom<U>>::Error>

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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more