Struct rings_core::swarm::callback::InnerSwarmCallback
source · pub struct InnerSwarmCallback { /* private fields */ }Expand description
InnerSwarmCallback wraps SharedSwarmCallback with inner handling for a specific connection.
Implementations§
source§impl InnerSwarmCallback
impl InnerSwarmCallback
sourcepub fn new(
transport: Arc<SwarmTransport>,
callback: SharedSwarmCallback
) -> Self
pub fn new( transport: Arc<SwarmTransport>, callback: SharedSwarmCallback ) -> Self
Create a new InnerSwarmCallback with the provided transport and callback.
Trait Implementations§
source§impl TransportCallback for InnerSwarmCallback
impl TransportCallback for InnerSwarmCallback
source§fn on_message<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
cid: &'life1 str,
msg: &'life2 [u8]
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn on_message<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
cid: &'life1 str,
msg: &'life2 [u8]
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
This method is invoked on a binary message arrival over the data channel of webrtc.
source§fn on_peer_connection_state_change<'life0, 'life1, 'async_trait>(
&'life0 self,
cid: &'life1 str,
s: WebrtcConnectionState
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn on_peer_connection_state_change<'life0, 'life1, 'async_trait>(
&'life0 self,
cid: &'life1 str,
s: WebrtcConnectionState
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
This method is invoked when the state of connection has changed.
Auto Trait Implementations§
impl !Freeze for InnerSwarmCallback
impl !RefUnwindSafe for InnerSwarmCallback
impl Send for InnerSwarmCallback
impl Sync for InnerSwarmCallback
impl Unpin for InnerSwarmCallback
impl !UnwindSafe for InnerSwarmCallback
Blanket Implementations§
source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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