Struct workflow_rpc::asynchronous::server::RpcWebSocketHandler
source · [−]pub struct RpcWebSocketHandler<Ops>where
Ops: Send + Sync + TryFrom<u32> + 'static,{ /* private fields */ }Implementations
sourceimpl<Ops> RpcWebSocketHandler<Ops>where
Ops: Send + Sync + TryFrom<u32> + 'static,
impl<Ops> RpcWebSocketHandler<Ops>where
Ops: Send + Sync + TryFrom<u32> + 'static,
pub fn new(rpc_handler: Arc<dyn RpcHandler<Ops>>) -> Self
Trait Implementations
sourceimpl<Ops: Clone> Clone for RpcWebSocketHandler<Ops>where
Ops: Send + Sync + TryFrom<u32> + 'static,
impl<Ops: Clone> Clone for RpcWebSocketHandler<Ops>where
Ops: Send + Sync + TryFrom<u32> + 'static,
sourcefn clone(&self) -> RpcWebSocketHandler<Ops>
fn clone(&self) -> RpcWebSocketHandler<Ops>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresourceimpl<Ops> WebSocketHandler for RpcWebSocketHandler<Ops>where
Ops: Send + Sync + TryFrom<u32> + 'static,
<Ops as TryFrom<u32>>::Error: Sync + Send + 'static,
impl<Ops> WebSocketHandler for RpcWebSocketHandler<Ops>where
Ops: Send + Sync + TryFrom<u32> + 'static,
<Ops as TryFrom<u32>>::Error: Sync + Send + 'static,
type Context = Arc<RpcContext>
type Context = Arc<RpcContext>
Context type used by impl trait to represent websocket connection
sourcefn connect<'life0, 'async_trait>(
self: &'life0 Arc<Self>,
peer: SocketAddr
) -> Pin<Box<dyn Future<Output = WebSocketResult<Self::Context>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn connect<'life0, 'async_trait>(
self: &'life0 Arc<Self>,
peer: SocketAddr
) -> Pin<Box<dyn Future<Output = WebSocketResult<Self::Context>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Called immediately when connection is established
This function can return an error to terminate the connection Read more
sourcefn handshake<'life0, 'life1, 'life2, 'async_trait>(
self: &'life0 Arc<Self>,
_ctx: &'life1 Self::Context,
_msg: Message,
_sink: &'life2 UnboundedSender<Message>
) -> Pin<Box<dyn Future<Output = WebSocketResult<()>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn handshake<'life0, 'life1, 'life2, 'async_trait>(
self: &'life0 Arc<Self>,
_ctx: &'life1 Self::Context,
_msg: Message,
_sink: &'life2 UnboundedSender<Message>
) -> Pin<Box<dyn Future<Output = WebSocketResult<()>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Called upon receipt of the first websocket message if
with_handshake() returns true
This function can return an error to terminate the connection Read moresourcefn message<'life0, 'life1, 'life2, 'async_trait>(
self: &'life0 Arc<Self>,
_ctx: &'life1 Self::Context,
msg: Message,
sink: &'life2 UnboundedSender<Message>
) -> Pin<Box<dyn Future<Output = WebSocketResult<()>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn message<'life0, 'life1, 'life2, 'async_trait>(
self: &'life0 Arc<Self>,
_ctx: &'life1 Self::Context,
msg: Message,
sink: &'life2 UnboundedSender<Message>
) -> Pin<Box<dyn Future<Output = WebSocketResult<()>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Called for every websocket message
This function can return an error to terminate the connection Read more
sourcefn with_handshake(self: &Arc<Self>) -> bool
fn with_handshake(self: &Arc<Self>) -> bool
Enables optional invocation of the handshake method with the first
message received form the incoming websocket Read more
sourcefn with_timeout(self: &Arc<Self>) -> Duration
fn with_timeout(self: &Arc<Self>) -> Duration
Sets the default connection timeout if no messages have been received
Auto Trait Implementations
impl<Ops> !RefUnwindSafe for RpcWebSocketHandler<Ops>
impl<Ops> Send for RpcWebSocketHandler<Ops>
impl<Ops> Sync for RpcWebSocketHandler<Ops>
impl<Ops> Unpin for RpcWebSocketHandler<Ops>
impl<Ops> !UnwindSafe for RpcWebSocketHandler<Ops>
Blanket Implementations
impl<T> Any for Twhere
T: Any,
impl<T> Any for Twhere
T: Any,
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more