pub enum ConnectStrategy {
Retry,
Fallback,
}
Expand description
ConnectionStrategy
specifies how the WebSocket async fn connect()
function should behave during the first-time connectivity phase.
@category WebSocket
Variants§
Retry
Continuously attempt to connect to the server. This behavior will
block connect()
function until the connection is established.
Fallback
Causes connect()
to return immediately if the first-time connection
has failed.
Implementations§
Source§impl ConnectStrategy
impl ConnectStrategy
pub fn new(retry: bool) -> ConnectStrategy
pub fn is_fallback(&self) -> bool
Trait Implementations§
Source§impl Clone for ConnectStrategy
impl Clone for ConnectStrategy
Source§fn clone(&self) -> ConnectStrategy
fn clone(&self) -> ConnectStrategy
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ConnectStrategy
impl Debug for ConnectStrategy
Source§impl Default for ConnectStrategy
impl Default for ConnectStrategy
Source§fn default() -> ConnectStrategy
fn default() -> ConnectStrategy
Returns the “default value” for a type. Read more
Source§impl From<ConnectStrategy> for JsValue
impl From<ConnectStrategy> for JsValue
Source§fn from(value: ConnectStrategy) -> JsValue
fn from(value: ConnectStrategy) -> JsValue
Converts to this type from the input type.
Source§impl FromStr for ConnectStrategy
impl FromStr for ConnectStrategy
Source§impl FromWasmAbi for ConnectStrategy
impl FromWasmAbi for ConnectStrategy
Source§impl IntoWasmAbi for ConnectStrategy
impl IntoWasmAbi for ConnectStrategy
Source§impl OptionFromWasmAbi for ConnectStrategy
impl OptionFromWasmAbi for ConnectStrategy
Source§fn is_none(val: &<ConnectStrategy as FromWasmAbi>::Abi) -> bool
fn is_none(val: &<ConnectStrategy as FromWasmAbi>::Abi) -> bool
Tests whether the argument is a “none” instance. If so it will be
deserialized as
None
, and otherwise it will be passed to
FromWasmAbi
.Source§impl OptionIntoWasmAbi for ConnectStrategy
impl OptionIntoWasmAbi for ConnectStrategy
Source§fn none() -> <ConnectStrategy as IntoWasmAbi>::Abi
fn none() -> <ConnectStrategy as IntoWasmAbi>::Abi
Returns an ABI instance indicating “none”, which JS will interpret as
the
None
branch of this option. Read moreSource§impl PartialEq for ConnectStrategy
impl PartialEq for ConnectStrategy
Source§impl TryFrom<JsValue> for ConnectStrategy
impl TryFrom<JsValue> for ConnectStrategy
Source§impl TryFromJsValue for ConnectStrategy
impl TryFromJsValue for ConnectStrategy
Source§fn try_from_js_value(
value: JsValue,
) -> Result<ConnectStrategy, <ConnectStrategy as TryFromJsValue>::Error>
fn try_from_js_value( value: JsValue, ) -> Result<ConnectStrategy, <ConnectStrategy as TryFromJsValue>::Error>
Performs the conversion.
Source§impl VectorFromWasmAbi for ConnectStrategy
impl VectorFromWasmAbi for ConnectStrategy
type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi
unsafe fn vector_from_abi( js: <ConnectStrategy as VectorFromWasmAbi>::Abi, ) -> Box<[ConnectStrategy]>
Source§impl VectorIntoWasmAbi for ConnectStrategy
impl VectorIntoWasmAbi for ConnectStrategy
type Abi = <Box<[JsValue]> as IntoWasmAbi>::Abi
fn vector_into_abi( vector: Box<[ConnectStrategy]>, ) -> <ConnectStrategy as VectorIntoWasmAbi>::Abi
impl Copy for ConnectStrategy
impl Eq for ConnectStrategy
impl StructuralPartialEq for ConnectStrategy
Auto Trait Implementations§
impl Freeze for ConnectStrategy
impl RefUnwindSafe for ConnectStrategy
impl Send for ConnectStrategy
impl Sync for ConnectStrategy
impl Unpin for ConnectStrategy
impl UnwindSafe for ConnectStrategy
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::Abi
Source§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi
, except that it may throw and never
return in the case of Err
.