pub struct Payload<T, C> {
pub value: Arc<T>,
pub neuron: Arc<dyn Neuron<T, C> + Send + Sync>,
pub trace: TraceContext,
}Fields§
§value: Arc<T>§neuron: Arc<dyn Neuron<T, C> + Send + Sync>§trace: TraceContextImplementations§
Source§impl<T, C> Payload<T, C>
impl<T, C> Payload<T, C>
pub fn from_parts( value: Arc<T>, neuron: Arc<dyn Neuron<T, C> + Send + Sync>, trace: TraceContext, ) -> Self
Sourcepub fn with_correlation(
value: T,
neuron: Arc<dyn Neuron<T, C> + Send + Sync>,
correlation_id: Option<Uuid>,
) -> Arc<Self>
pub fn with_correlation( value: T, neuron: Arc<dyn Neuron<T, C> + Send + Sync>, correlation_id: Option<Uuid>, ) -> Arc<Self>
Helper to create a new Payload with default tracing fields (new span_id, no parent_id). Used when initiating a new signal.
Sourcepub fn new(value: T, neuron: Arc<dyn Neuron<T, C> + Send + Sync>) -> Arc<Self>
pub fn new(value: T, neuron: Arc<dyn Neuron<T, C> + Send + Sync>) -> Arc<Self>
Simplified creation method for new signals. automatically generates correlation_id and other tracing fields.
pub fn builder() -> PayloadBuilder<T, C>
pub fn correlation_id(&self) -> Uuid
pub fn span_id(&self) -> u64
pub fn parent_id(&self) -> Option<u64>
Trait Implementations§
Source§impl<T, C> LogTrace for Payload<T, C>
impl<T, C> LogTrace for Payload<T, C>
fn correlation_id(&self) -> Uuid
fn span_id(&self) -> u64
fn parent_id(&self) -> Option<u64>
fn neuron_name(&self) -> String
Source§fn trace_context(&self) -> TraceContext
fn trace_context(&self) -> TraceContext
Returns the full trace context.
Source§fn span_info(&self, name: &'static str) -> Span
fn span_info(&self, name: &'static str) -> Span
Returns a tracing span with the tracing fields attached at INFO level.
Source§fn span_debug(&self, name: &'static str) -> Span
fn span_debug(&self, name: &'static str) -> Span
Returns a tracing span with the tracing fields attached at DEBUG level.
Auto Trait Implementations§
impl<T, C> Freeze for Payload<T, C>
impl<T, C> !RefUnwindSafe for Payload<T, C>
impl<T, C> Send for Payload<T, C>
impl<T, C> Sync for Payload<T, C>
impl<T, C> Unpin for Payload<T, C>
impl<T, C> !UnwindSafe for Payload<T, C>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more