#[repr(transparent)]pub struct WebSocket { /* private fields */ }
Expand description
The WebSocket
object
This API requires the following crate features to be activated: WebSocket
Implementations§
source§impl WebSocket
impl WebSocket
source§impl WebSocket
impl WebSocket
source§impl WebSocket
impl WebSocket
source§impl WebSocket
impl WebSocket
source§impl WebSocket
impl WebSocket
source§impl WebSocket
impl WebSocket
sourcepub fn send_with_array_buffer(&self, data: &ArrayBuffer) -> Result<(), JsValue>
pub fn send_with_array_buffer(&self, data: &ArrayBuffer) -> Result<(), JsValue>
The send()
method
This API requires the following crate features to be activated: WebSocket
source§impl WebSocket
impl WebSocket
source§impl WebSocket
impl WebSocket
source§impl WebSocket
impl WebSocket
source§impl WebSocket
impl WebSocket
sourcepub fn ready_state(&self) -> u16
pub fn ready_state(&self) -> u16
The readyState
getter
This API requires the following crate features to be activated: WebSocket
source§impl WebSocket
impl WebSocket
sourcepub fn buffered_amount(&self) -> u32
pub fn buffered_amount(&self) -> u32
The bufferedAmount
getter
This API requires the following crate features to be activated: WebSocket
source§impl WebSocket
impl WebSocket
source§impl WebSocket
impl WebSocket
sourcepub fn set_onopen(&self, onopen: Option<&Function>)
pub fn set_onopen(&self, onopen: Option<&Function>)
The onopen
setter
This API requires the following crate features to be activated: WebSocket
source§impl WebSocket
impl WebSocket
source§impl WebSocket
impl WebSocket
sourcepub fn set_onerror(&self, onerror: Option<&Function>)
pub fn set_onerror(&self, onerror: Option<&Function>)
The onerror
setter
This API requires the following crate features to be activated: WebSocket
source§impl WebSocket
impl WebSocket
source§impl WebSocket
impl WebSocket
sourcepub fn set_onclose(&self, onclose: Option<&Function>)
pub fn set_onclose(&self, onclose: Option<&Function>)
The onclose
setter
This API requires the following crate features to be activated: WebSocket
source§impl WebSocket
impl WebSocket
sourcepub fn extensions(&self) -> String
pub fn extensions(&self) -> String
The extensions
getter
This API requires the following crate features to be activated: WebSocket
source§impl WebSocket
impl WebSocket
source§impl WebSocket
impl WebSocket
source§impl WebSocket
impl WebSocket
sourcepub fn set_onmessage(&self, onmessage: Option<&Function>)
pub fn set_onmessage(&self, onmessage: Option<&Function>)
The onmessage
setter
This API requires the following crate features to be activated: WebSocket
source§impl WebSocket
impl WebSocket
sourcepub fn binary_type(&self) -> BinaryType
pub fn binary_type(&self) -> BinaryType
The binaryType
getter
This API requires the following crate features to be activated: BinaryType
, WebSocket
source§impl WebSocket
impl WebSocket
sourcepub fn set_binary_type(&self, binary_type: BinaryType)
pub fn set_binary_type(&self, binary_type: BinaryType)
The binaryType
setter
This API requires the following crate features to be activated: BinaryType
, WebSocket
Trait Implementations§
source§impl AsRef<EventTarget> for WebSocket
impl AsRef<EventTarget> for WebSocket
source§fn as_ref(&self) -> &EventTarget
fn as_ref(&self) -> &EventTarget
source§impl From<WebSocket> for EventTarget
impl From<WebSocket> for EventTarget
source§fn from(obj: WebSocket) -> EventTarget
fn from(obj: WebSocket) -> EventTarget
source§impl FromWasmAbi for WebSocket
impl FromWasmAbi for WebSocket
source§impl<'a> IntoWasmAbi for &'a WebSocket
impl<'a> IntoWasmAbi for &'a WebSocket
source§impl IntoWasmAbi for WebSocket
impl IntoWasmAbi for WebSocket
source§impl JsCast for WebSocket
impl JsCast for WebSocket
source§fn instanceof(val: &JsValue) -> bool
fn instanceof(val: &JsValue) -> bool
instanceof
check to see whether the JsValue
provided is an instance of this type. Read moresource§fn unchecked_from_js(val: JsValue) -> Self
fn unchecked_from_js(val: JsValue) -> Self
source§fn unchecked_from_js_ref(val: &JsValue) -> &Self
fn unchecked_from_js_ref(val: &JsValue) -> &Self
source§fn is_instance_of<T>(&self) -> boolwhere
T: JsCast,
fn is_instance_of<T>(&self) -> boolwhere
T: JsCast,
T
. Read moresource§fn dyn_into<T>(self) -> Result<T, Self>where
T: JsCast,
fn dyn_into<T>(self) -> Result<T, Self>where
T: JsCast,
T
. Read moresource§fn dyn_ref<T>(&self) -> Option<&T>where
T: JsCast,
fn dyn_ref<T>(&self) -> Option<&T>where
T: JsCast,
T
. Read moresource§fn unchecked_into<T>(self) -> Twhere
T: JsCast,
fn unchecked_into<T>(self) -> Twhere
T: JsCast,
source§impl OptionFromWasmAbi for WebSocket
impl OptionFromWasmAbi for WebSocket
source§impl<'a> OptionIntoWasmAbi for &'a WebSocket
impl<'a> OptionIntoWasmAbi for &'a WebSocket
source§impl OptionIntoWasmAbi for WebSocket
impl OptionIntoWasmAbi for WebSocket
source§impl RefFromWasmAbi for WebSocket
impl RefFromWasmAbi for WebSocket
§type Abi = <JsValue as RefFromWasmAbi>::Abi
type Abi = <JsValue as RefFromWasmAbi>::Abi
Self
are recovered from.§type Anchor = ManuallyDrop<WebSocket>
type Anchor = ManuallyDrop<WebSocket>
Self
for the duration of the
invocation of the function that has an &Self
parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous. Read moreAuto Trait Implementations§
impl RefUnwindSafe for WebSocket
impl Send for WebSocket
impl Sync for WebSocket
impl Unpin for WebSocket
impl UnwindSafe for WebSocket
Blanket Implementations§
source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
IntoWasmAbi::Abi
source§fn return_abi(self, extra: &mut dyn Stack) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self, extra: &mut dyn Stack) -> <T as ReturnWasmAbi>::Abi
IntoWasmAbi::into_abi
, except that it may throw and never
return in the case of Err
. Read more