[−][src]Enum ws_stream_wasm::WsErr
The error type for errors happening in ws_stream_wasm
.
Variants (Non-exhaustive)
Invalid input to WsState::try_from( u16 ).
Fields of InvalidWsState
supplied: u16
The user supplied value that is invalid.
When trying to send and WsState is anything but WsState::Open this error is returned.
Browsers will forbid making websocket connections to certain ports. See this Stack Overflow question.
An invalid URL was given to WsMeta::connect, please see: HTML Living Standard.
Fields of InvalidUrl
supplied: String
The user supplied value that is invalid.
An invalid close code was given to a close method. For valid close codes, please see: MDN Documentation.
Fields of InvalidCloseCode
supplied: u16
The user supplied value that is invalid.
The reason string given to a close method is longer than 123 bytes, please see: MDN Documentation.
Failed to connect to the server.
Fields of ConnectionFailed
event: CloseEvent
The close event that might hold extra code and reason information.
When converting the JavaScript Message into a WsMessage, it's possible that
a String message doesn't convert correctly as Js does not guarantee that
strings are valid Unicode. Happens in impl TryFrom< MessageEvent > for WsMessage
.
When converting the JavaScript Message into a WsMessage, it's not possible to
convert Blob type messages, as Blob is a streaming type, that needs to be read
asynchronously. If you are using the type without setting up the connection with
[WsMeta::connect
], you have to make sure to set the binary type of the connection
to ArrayBuffer
.
Happens in impl TryFrom< MessageEvent > for WsMessage
.
When converting the JavaScript Message into a WsMessage, the data type was neither
Arraybuffer
, String
nor Blob
. This should never happen. If it does, please
try to make a reproducible example and file an issue.
Happens in impl TryFrom< MessageEvent > for WsMessage
.
Trait Implementations
impl Clone for WsErr
[src]
impl Debug for WsErr
[src]
impl Display for WsErr
[src]
impl Eq for WsErr
[src]
impl Error for WsErr
[src]
fn source(&self) -> Option<&(dyn Error + 'static)>
1.30.0[src]
fn backtrace(&self) -> Option<&Backtrace>
[src]
fn description(&self) -> &str
1.0.0[src]
fn cause(&self) -> Option<&dyn Error>
1.0.0[src]
impl PartialEq<WsErr> for WsErr
[src]
impl StructuralEq for WsErr
[src]
impl StructuralPartialEq for WsErr
[src]
Auto Trait Implementations
impl RefUnwindSafe for WsErr
impl Send for WsErr
impl Sync for WsErr
impl Unpin for WsErr
impl UnwindSafe for WsErr
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,