pub struct TracingHandler<H> { /* private fields */ }Expand description
A tracing wrapper for choreographic handlers.
Implementations§
Source§impl<H> TracingHandler<H>
impl<H> TracingHandler<H>
Sourcepub fn new(inner: H, protocol: &'static str, role: H::Role) -> Selfwhere
H: ChoreoHandler,
pub fn new(inner: H, protocol: &'static str, role: H::Role) -> Selfwhere
H: ChoreoHandler,
Create a new tracing handler.
Sourcepub fn indexed(
inner: H,
protocol: &'static str,
role: RoleName,
index: u32,
) -> Self
pub fn indexed( inner: H, protocol: &'static str, role: RoleName, index: u32, ) -> Self
Create a new tracing handler for an indexed role.
Sourcepub fn role_index(&self) -> Option<u32>
pub fn role_index(&self) -> Option<u32>
Get the role index (if any).
Sourcepub fn into_inner(self) -> H
pub fn into_inner(self) -> H
Unwrap and return the inner handler.
Trait Implementations§
Source§impl<H: ChoreoHandler> ChoreoHandler for TracingHandler<H>
impl<H: ChoreoHandler> ChoreoHandler for TracingHandler<H>
Source§type Role = <H as ChoreoHandler>::Role
type Role = <H as ChoreoHandler>::Role
The role type for this choreography
Source§type Endpoint = <H as ChoreoHandler>::Endpoint
type Endpoint = <H as ChoreoHandler>::Endpoint
The endpoint type maintaining connection state
Source§fn send<'life0, 'life1, 'life2, 'async_trait, M>(
&'life0 mut self,
ep: &'life1 mut Self::Endpoint,
to: Self::Role,
msg: &'life2 M,
) -> Pin<Box<dyn Future<Output = ChoreoResult<()>> + Send + 'async_trait>>
fn send<'life0, 'life1, 'life2, 'async_trait, M>( &'life0 mut self, ep: &'life1 mut Self::Endpoint, to: Self::Role, msg: &'life2 M, ) -> Pin<Box<dyn Future<Output = ChoreoResult<()>> + Send + 'async_trait>>
Send a message to a specific role Read more
Source§fn recv<'life0, 'life1, 'async_trait, M>(
&'life0 mut self,
ep: &'life1 mut Self::Endpoint,
from: Self::Role,
) -> Pin<Box<dyn Future<Output = ChoreoResult<M>> + Send + 'async_trait>>where
M: 'async_trait + DeserializeOwned + Send,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn recv<'life0, 'life1, 'async_trait, M>(
&'life0 mut self,
ep: &'life1 mut Self::Endpoint,
from: Self::Role,
) -> Pin<Box<dyn Future<Output = ChoreoResult<M>> + Send + 'async_trait>>where
M: 'async_trait + DeserializeOwned + Send,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Receive a strongly-typed message from a specific role Read more
Source§fn choose<'life0, 'life1, 'async_trait>(
&'life0 mut self,
ep: &'life1 mut Self::Endpoint,
to: Self::Role,
label: <Self::Role as RoleId>::Label,
) -> Pin<Box<dyn Future<Output = ChoreoResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn choose<'life0, 'life1, 'async_trait>(
&'life0 mut self,
ep: &'life1 mut Self::Endpoint,
to: Self::Role,
label: <Self::Role as RoleId>::Label,
) -> Pin<Box<dyn Future<Output = ChoreoResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Internal choice: broadcast a label selection Read more
Source§fn offer<'life0, 'life1, 'async_trait>(
&'life0 mut self,
ep: &'life1 mut Self::Endpoint,
from: Self::Role,
) -> Pin<Box<dyn Future<Output = ChoreoResult<<Self::Role as RoleId>::Label>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn offer<'life0, 'life1, 'async_trait>(
&'life0 mut self,
ep: &'life1 mut Self::Endpoint,
from: Self::Role,
) -> Pin<Box<dyn Future<Output = ChoreoResult<<Self::Role as RoleId>::Label>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
External choice: receive a label selection Read more
Source§fn with_timeout<'life0, 'life1, 'async_trait, F, T>(
&'life0 mut self,
ep: &'life1 mut Self::Endpoint,
at: Self::Role,
dur: Duration,
body: F,
) -> Pin<Box<dyn Future<Output = ChoreoResult<T>> + Send + 'async_trait>>where
F: Future<Output = ChoreoResult<T>> + Send + 'async_trait,
T: 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn with_timeout<'life0, 'life1, 'async_trait, F, T>(
&'life0 mut self,
ep: &'life1 mut Self::Endpoint,
at: Self::Role,
dur: Duration,
body: F,
) -> Pin<Box<dyn Future<Output = ChoreoResult<T>> + Send + 'async_trait>>where
F: Future<Output = ChoreoResult<T>> + Send + 'async_trait,
T: 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Execute a future with a timeout Read more
Source§fn broadcast<'life0, 'life1, 'life2, 'life3, 'async_trait, M>(
&'life0 mut self,
ep: &'life1 mut Self::Endpoint,
recipients: &'life2 [Self::Role],
msg: &'life3 M,
) -> Pin<Box<dyn Future<Output = ChoreoResult<()>> + Send + 'async_trait>>
fn broadcast<'life0, 'life1, 'life2, 'life3, 'async_trait, M>( &'life0 mut self, ep: &'life1 mut Self::Endpoint, recipients: &'life2 [Self::Role], msg: &'life3 M, ) -> Pin<Box<dyn Future<Output = ChoreoResult<()>> + Send + 'async_trait>>
Broadcast a message to multiple recipients Read more
Auto Trait Implementations§
impl<H> Freeze for TracingHandler<H>where
H: Freeze,
impl<H> !RefUnwindSafe for TracingHandler<H>
impl<H> Send for TracingHandler<H>where
H: Send,
impl<H> Sync for TracingHandler<H>where
H: Sync,
impl<H> Unpin for TracingHandler<H>where
H: Unpin,
impl<H> UnsafeUnpin for TracingHandler<H>where
H: UnsafeUnpin,
impl<H> !UnwindSafe for TracingHandler<H>
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> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Casts the value.
Source§impl<T> ChoreoHandlerExt for Twhere
T: ChoreoHandler,
impl<T> ChoreoHandlerExt for Twhere
T: ChoreoHandler,
Source§fn run_program<'life0, 'life1, 'async_trait, M>(
&'life0 mut self,
endpoint: &'life1 mut Self::Endpoint,
program: Program<Self::Role, M>,
) -> Pin<Box<dyn Future<Output = ChoreoResult<InterpretResult<M>>> + Send + 'async_trait>>where
M: ProgramMessage + Serialize + DeserializeOwned + 'static + 'async_trait,
Self: Send + Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn run_program<'life0, 'life1, 'async_trait, M>(
&'life0 mut self,
endpoint: &'life1 mut Self::Endpoint,
program: Program<Self::Role, M>,
) -> Pin<Box<dyn Future<Output = ChoreoResult<InterpretResult<M>>> + Send + 'async_trait>>where
M: ProgramMessage + Serialize + DeserializeOwned + 'static + 'async_trait,
Self: Send + Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Run a choreographic program using this handler
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<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
Source§fn lossless_try_into(self) -> Option<Dst>
fn lossless_try_into(self) -> Option<Dst>
Performs the conversion.
Source§impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
Source§fn lossy_into(self) -> Dst
fn lossy_into(self) -> Dst
Performs the conversion.
Source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
Source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Casts the value.
Source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
Source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
Source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> StrictAs for T
impl<T> StrictAs for T
Source§fn strict_as<Dst>(self) -> Dstwhere
T: StrictCast<Dst>,
fn strict_as<Dst>(self) -> Dstwhere
T: StrictCast<Dst>,
Casts the value.
Source§impl<Src, Dst> StrictCastFrom<Src> for Dstwhere
Src: StrictCast<Dst>,
impl<Src, Dst> StrictCastFrom<Src> for Dstwhere
Src: StrictCast<Dst>,
Source§fn strict_cast_from(src: Src) -> Dst
fn strict_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
Source§fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
Source§fn unwrapped_cast_from(src: Src) -> Dst
fn unwrapped_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Source§impl<T> WrappingAs for T
impl<T> WrappingAs for T
Source§fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
Source§fn wrapping_cast_from(src: Src) -> Dst
fn wrapping_cast_from(src: Src) -> Dst
Casts the value.