pub struct PayloadErasedWrapper<T: 'static, C: 'static> { /* private fields */ }Expand description
Wrapper that implements PayloadErased for any concrete Payload
Implementations§
Source§impl<T, C> PayloadErasedWrapper<T, C>
impl<T, C> PayloadErasedWrapper<T, C>
pub fn new(payload: Arc<Payload<T, C>>) -> Self
Sourcepub fn from_typed_payload(
payload: Arc<Payload<T, C>>,
) -> Arc<dyn PayloadErased + Send + Sync + 'static>
pub fn from_typed_payload( payload: Arc<Payload<T, C>>, ) -> Arc<dyn PayloadErased + Send + Sync + 'static>
Create a type-erased payload from a correctly typed payload
Sourcepub fn get_typed_payload(&self) -> Arc<Payload<T, C>>
pub fn get_typed_payload(&self) -> Arc<Payload<T, C>>
Get the underlying typed payload
Sourcepub fn get_erased_neuron(&self) -> Arc<dyn NeuronErased + Send + Sync + 'static>
pub fn get_erased_neuron(&self) -> Arc<dyn NeuronErased + Send + Sync + 'static>
Get the neuron as a type-erased neuron
Sourcepub fn to_typed_payload<U, D>(&self) -> ErasureResult<Arc<Payload<U, D>>>
pub fn to_typed_payload<U, D>(&self) -> ErasureResult<Arc<Payload<U, D>>>
Convert this wrapper to a correctly typed payload with different type parameters Returns an error if the type parameters don’t match
Trait Implementations§
Source§impl<T, C> LogTrace for PayloadErasedWrapper<T, C>
impl<T, C> LogTrace for PayloadErasedWrapper<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.
Source§impl<T, C> PayloadErased for PayloadErasedWrapper<T, C>
impl<T, C> PayloadErased for PayloadErasedWrapper<T, C>
fn as_any(&self) -> &dyn Any
fn get_trace_context(&self) -> TraceContext
fn get_neuron_name(&self) -> String
fn payload_type_id(&self) -> TypeId
fn codec_type_id(&self) -> TypeId
fn clone_to_box(&self) -> Box<dyn PayloadErased + Send + Sync + 'static>
fn clone_to_arc(&self) -> Arc<dyn PayloadErased + Send + Sync + 'static>
fn get_erased_neuron(&self) -> Arc<dyn NeuronErased + Send + Sync + 'static>
fn get_value(&self) -> &dyn Any
fn get_correlation_id(&self) -> Uuid
fn get_span_id(&self) -> u64
fn get_parent_id(&self) -> Option<u64>
Auto Trait Implementations§
impl<T, C> Freeze for PayloadErasedWrapper<T, C>
impl<T, C> !RefUnwindSafe for PayloadErasedWrapper<T, C>
impl<T, C> Send for PayloadErasedWrapper<T, C>
impl<T, C> Sync for PayloadErasedWrapper<T, C>
impl<T, C> Unpin for PayloadErasedWrapper<T, C>
impl<T, C> !UnwindSafe for PayloadErasedWrapper<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