Enum fluvio_ws_stream_wasm::WsErr [−][src]
#[non_exhaustive] pub enum WsErr { InvalidWsState { supplied: u16, }, ConnectionNotOpen, InvalidUrl { supplied: String, }, InvalidCloseCode { supplied: u16, }, ReasonStringToLong, ConnectionFailed { event: CloseEvent, }, InvalidEncoding, CantDecodeBlob, UnknownDataType, }
Expand description
The error type for errors happening in ws_stream_wasm
.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
Invalid input to WsState::try_from( u16 ).
Show fields
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.
An invalid URL was given to WsMeta::connect, please see: HTML Living Standard.
Show fields
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.
Show fields
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.
Show fields
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 Error for WsErr
[src]
impl Error for WsErr
[src]fn source(&self) -> Option<&(dyn Error + 'static)>
1.30.0[src]
fn source(&self) -> Option<&(dyn Error + 'static)>
1.30.0[src]The lower-level source of this error, if any. Read more
fn backtrace(&self) -> Option<&Backtrace>
[src]
fn backtrace(&self) -> Option<&Backtrace>
[src]backtrace
)Returns a stack backtrace, if available, of where this error occurred. Read more
fn description(&self) -> &str
1.0.0[src]
fn description(&self) -> &str
1.0.0[src]use the Display impl or to_string()
impl Eq 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> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more