pub struct WebSocketOptions { /* private fields */ }Available on crate feature
fullstack only.Implementations§
Source§impl WebSocketOptions
impl WebSocketOptions
pub fn new() -> WebSocketOptions
Available on crate feature
ws only.Sourcepub fn with_automatic_reconnect(self) -> WebSocketOptions
Available on crate feature ws only.
pub fn with_automatic_reconnect(self) -> WebSocketOptions
ws only.Automatically reconnect if the connection is lost. This uses an exponential backoff strategy.
pub fn on_failed_upgrade( self, callback: impl FnOnce(Error) + Send + 'static, ) -> WebSocketOptions
Available on crate features
ws and server only.pub fn on_upgrade<F, Fut, In, Out, Enc>(
self,
callback: F,
) -> Websocket<In, Out, Enc>where
F: FnOnce(TypedWebsocket<In, Out, Enc>) -> Fut + Send + 'static,
Fut: Future<Output = ()> + 'static,
Available on crate features
ws and server only.Trait Implementations§
Source§impl Default for WebSocketOptions
impl Default for WebSocketOptions
Source§fn default() -> WebSocketOptions
fn default() -> WebSocketOptions
Returns the “default value” for a type. Read more
Source§impl<S> FromRequest<S> for WebSocketOptionswhere
S: Send,
impl<S> FromRequest<S> for WebSocketOptionswhere
S: Send,
Source§type Rejection = Response<Body>
type Rejection = Response<Body>
If the extractor fails it’ll use this “rejection” type. A rejection is
a kind of error that can be converted into a response.
Source§fn from_request(
_req: Request<Body>,
_: &S,
) -> impl Future<Output = Result<WebSocketOptions, <WebSocketOptions as FromRequest<S>>::Rejection>> + Send
fn from_request( _req: Request<Body>, _: &S, ) -> impl Future<Output = Result<WebSocketOptions, <WebSocketOptions as FromRequest<S>>::Rejection>> + Send
Perform the extraction.
Auto Trait Implementations§
impl !Freeze for WebSocketOptions
impl !RefUnwindSafe for WebSocketOptions
impl Send for WebSocketOptions
impl !Sync for WebSocketOptions
impl Unpin for WebSocketOptions
impl UnsafeUnpin for WebSocketOptions
impl !UnwindSafe for WebSocketOptions
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> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
Source§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Create an instance of this type from an initialization function
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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<Ret> SpawnIfAsync<(), Ret> for Ret
impl<Ret> SpawnIfAsync<(), Ret> for Ret
Source§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
Source§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
Source§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
Source§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.