pub struct WebSocketGatewayDefinition { /* private fields */ }Expand description
Framework-neutral WebSocket gateway definition.
Implementations§
Source§impl WebSocketGatewayDefinition
impl WebSocketGatewayDefinition
pub fn new(path: impl Into<String>) -> Result<Self>
pub fn path(&self) -> &str
pub fn path_shape(&self) -> String
pub fn module_name(&self) -> Option<&str>
pub fn events(&self) -> Vec<&str>
pub fn matches_path(&self, path: &str) -> bool
pub fn path_params( &self, path: &str, ) -> Result<Option<BTreeMap<String, String>>>
pub fn subscribe<H, Fut, R>(
self,
event: impl Into<String>,
handler: H,
) -> Result<Self>where
H: Fn(WebSocketMessage) -> Fut + Send + Sync + 'static,
Fut: Future<Output = Result<R>> + Send + 'static,
R: IntoWebSocketReply + Send + 'static,
pub fn with_pipe<P>(self, pipe: P) -> Selfwhere
P: WebSocketPipe,
pub fn with_guard<G>(self, guard: G) -> Selfwhere
G: WebSocketGuard,
pub fn with_execution_guard<G>(self, guard: G) -> Selfwhere
G: Guard,
pub fn with_interceptor<I>(self, interceptor: I) -> Selfwhere
I: WebSocketInterceptor,
pub fn with_execution_interceptor<I>(self, interceptor: I) -> Selfwhere
I: ExecutionInterceptor,
pub fn connect( &self, request: BootRequest, ) -> Result<WebSocketGatewayConnection>
pub async fn dispatch( &self, request: BootRequest, message: WebSocketMessage, ) -> Result<Option<WebSocketMessage>>
Trait Implementations§
Source§impl Clone for WebSocketGatewayDefinition
impl Clone for WebSocketGatewayDefinition
Source§fn clone(&self) -> WebSocketGatewayDefinition
fn clone(&self) -> WebSocketGatewayDefinition
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for WebSocketGatewayDefinition
impl !UnwindSafe for WebSocketGatewayDefinition
impl Freeze for WebSocketGatewayDefinition
impl Send for WebSocketGatewayDefinition
impl Sync for WebSocketGatewayDefinition
impl Unpin for WebSocketGatewayDefinition
impl UnsafeUnpin for WebSocketGatewayDefinition
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