pub struct WebSocketSubscriptionDefinition { /* private fields */ }Expand description
Handler definition for one WebSocket subscription.
Implementations§
Source§impl WebSocketSubscriptionDefinition
impl WebSocketSubscriptionDefinition
pub fn new<H, Fut, R>(handler: H) -> Selfwhere
H: Fn(WebSocketMessage) -> Fut + Send + Sync + 'static,
Fut: Future<Output = Result<R>> + Send + 'static,
R: IntoWebSocketReply + Send + 'static,
pub fn new_with_connection<H, Fut, R>(handler: H) -> Selfwhere
H: Fn(WebSocketGatewayConnection, WebSocketMessage) -> Fut + Send + Sync + 'static,
Fut: Future<Output = Result<R>> + Send + 'static,
R: IntoWebSocketReply + Send + 'static,
pub fn new_with_server<H, Fut, R>(handler: H) -> Selfwhere
H: Fn(WebSocketGatewayServer, WebSocketMessage) -> Fut + Send + Sync + 'static,
Fut: Future<Output = Result<R>> + Send + 'static,
R: IntoWebSocketReply + Send + 'static,
pub fn metadata(&self) -> &BTreeMap<String, Value>
pub fn metadata_value(&self, key: &str) -> Option<&Value>
pub fn with_metadata<V>(self, key: impl Into<String>, value: V) -> Result<Self>where
V: Serialize,
pub fn with_metadata_value(self, key: impl Into<String>, value: Value) -> Self
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_interceptor<I>(self, interceptor: I) -> Selfwhere
I: WebSocketInterceptor,
pub fn with_filter<F>(self, filter: F) -> Selfwhere
F: WebSocketExceptionFilter,
pub fn with_catch_filter<I, F>(self, kinds: I, filter: F) -> Self
pub fn with_validation(self) -> Self
pub fn with_validation_options(self, options: ValidationOptions) -> Self
pub fn without_validation(self) -> Self
pub fn with_payload_validation<T>(self) -> Selfwhere
T: DeserializeOwned + Validate + 'static,
pub fn with_payload_validation_options<T>( self, options: ValidationOptions, ) -> Self
Trait Implementations§
Source§impl Clone for WebSocketSubscriptionDefinition
impl Clone for WebSocketSubscriptionDefinition
Source§fn clone(&self) -> WebSocketSubscriptionDefinition
fn clone(&self) -> WebSocketSubscriptionDefinition
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 WebSocketSubscriptionDefinition
impl !UnwindSafe for WebSocketSubscriptionDefinition
impl Freeze for WebSocketSubscriptionDefinition
impl Send for WebSocketSubscriptionDefinition
impl Sync for WebSocketSubscriptionDefinition
impl Unpin for WebSocketSubscriptionDefinition
impl UnsafeUnpin for WebSocketSubscriptionDefinition
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