pub struct ProducerContext { /* private fields */ }Expand description
Context provided to producers for dependency injection.
ProducerContext holds references to shared infrastructure components
that producers may need access to during message production.
Implementations§
Source§impl ProducerContext
impl ProducerContext
Sourcepub fn with_runtime(self, runtime: Arc<dyn RuntimeHandle>) -> Self
pub fn with_runtime(self, runtime: Arc<dyn RuntimeHandle>) -> Self
Attaches a runtime command/query handle.
Sourcepub fn runtime(&self) -> Option<&Arc<dyn RuntimeHandle>>
pub fn runtime(&self) -> Option<&Arc<dyn RuntimeHandle>>
Returns the runtime command/query handle, if configured.
Trait Implementations§
Source§impl Clone for ProducerContext
impl Clone for ProducerContext
Source§fn clone(&self) -> ProducerContext
fn clone(&self) -> ProducerContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ProducerContext
impl !RefUnwindSafe for ProducerContext
impl Send for ProducerContext
impl Sync for ProducerContext
impl Unpin for ProducerContext
impl UnsafeUnpin for ProducerContext
impl !UnwindSafe for ProducerContext
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