#[repr(transparent)]pub struct TcpSocket { /* private fields */ }
Expand description
The TCPSocket
object
This API requires the following crate features to be activated: TcpSocket
Implementations§
source§impl TcpSocket
impl TcpSocket
sourcepub fn new_with_options(
host: &str,
port: u16,
options: &SocketOptions
) -> Result<TcpSocket, JsValue>
pub fn new_with_options(
host: &str,
port: u16,
options: &SocketOptions
) -> Result<TcpSocket, JsValue>
The new TCPSocket(..)
constructor, creating a new instance of TCPSocket
This API requires the following crate features to be activated: SocketOptions
, TcpSocket
source§impl TcpSocket
impl TcpSocket
source§impl TcpSocket
impl TcpSocket
source§impl TcpSocket
impl TcpSocket
sourcepub fn send_with_array_buffer(&self, data: &ArrayBuffer) -> Result<bool, JsValue>
pub fn send_with_array_buffer(&self, data: &ArrayBuffer) -> Result<bool, JsValue>
The send()
method
This API requires the following crate features to be activated: TcpSocket
source§impl TcpSocket
impl TcpSocket
sourcepub fn send_with_array_buffer_and_byte_offset(
&self,
data: &ArrayBuffer,
byte_offset: u32
) -> Result<bool, JsValue>
pub fn send_with_array_buffer_and_byte_offset(
&self,
data: &ArrayBuffer,
byte_offset: u32
) -> Result<bool, JsValue>
The send()
method
This API requires the following crate features to be activated: TcpSocket
source§impl TcpSocket
impl TcpSocket
sourcepub fn send_with_array_buffer_and_byte_offset_and_byte_length(
&self,
data: &ArrayBuffer,
byte_offset: u32,
byte_length: u32
) -> Result<bool, JsValue>
pub fn send_with_array_buffer_and_byte_offset_and_byte_length(
&self,
data: &ArrayBuffer,
byte_offset: u32,
byte_length: u32
) -> Result<bool, JsValue>
The send()
method
This API requires the following crate features to be activated: TcpSocket
source§impl TcpSocket
impl TcpSocket
source§impl TcpSocket
impl TcpSocket
sourcepub fn upgrade_to_secure(&self) -> Result<(), JsValue>
pub fn upgrade_to_secure(&self) -> Result<(), JsValue>
The upgradeToSecure()
method
This API requires the following crate features to be activated: TcpSocket
source§impl TcpSocket
impl TcpSocket
source§impl TcpSocket
impl TcpSocket
source§impl TcpSocket
impl TcpSocket
source§impl TcpSocket
impl TcpSocket
sourcepub fn buffered_amount(&self) -> f64
pub fn buffered_amount(&self) -> f64
The bufferedAmount
getter
This API requires the following crate features to be activated: TcpSocket
source§impl TcpSocket
impl TcpSocket
sourcepub fn ready_state(&self) -> TcpReadyState
pub fn ready_state(&self) -> TcpReadyState
The readyState
getter
This API requires the following crate features to be activated: TcpReadyState
, TcpSocket
source§impl TcpSocket
impl TcpSocket
sourcepub fn binary_type(&self) -> TcpSocketBinaryType
pub fn binary_type(&self) -> TcpSocketBinaryType
The binaryType
getter
This API requires the following crate features to be activated: TcpSocket
, TcpSocketBinaryType
source§impl TcpSocket
impl TcpSocket
source§impl TcpSocket
impl TcpSocket
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: TcpSocket
source§impl TcpSocket
impl TcpSocket
source§impl TcpSocket
impl TcpSocket
sourcepub fn set_ondrain(&self, ondrain: Option<&Function>)
pub fn set_ondrain(&self, ondrain: Option<&Function>)
The ondrain
setter
This API requires the following crate features to be activated: TcpSocket
source§impl TcpSocket
impl TcpSocket
source§impl TcpSocket
impl TcpSocket
sourcepub fn set_ondata(&self, ondata: Option<&Function>)
pub fn set_ondata(&self, ondata: Option<&Function>)
The ondata
setter
This API requires the following crate features to be activated: TcpSocket
source§impl TcpSocket
impl TcpSocket
source§impl TcpSocket
impl TcpSocket
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: TcpSocket
source§impl TcpSocket
impl TcpSocket
Trait Implementations§
source§impl AsRef<EventTarget> for TcpSocket
impl AsRef<EventTarget> for TcpSocket
source§fn as_ref(&self) -> &EventTarget
fn as_ref(&self) -> &EventTarget
source§impl From<TcpSocket> for EventTarget
impl From<TcpSocket> for EventTarget
source§fn from(obj: TcpSocket) -> EventTarget
fn from(obj: TcpSocket) -> EventTarget
source§impl FromWasmAbi for TcpSocket
impl FromWasmAbi for TcpSocket
source§impl<'a> IntoWasmAbi for &'a TcpSocket
impl<'a> IntoWasmAbi for &'a TcpSocket
source§impl IntoWasmAbi for TcpSocket
impl IntoWasmAbi for TcpSocket
source§impl JsCast for TcpSocket
impl JsCast for TcpSocket
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 TcpSocket
impl OptionFromWasmAbi for TcpSocket
source§impl<'a> OptionIntoWasmAbi for &'a TcpSocket
impl<'a> OptionIntoWasmAbi for &'a TcpSocket
source§impl OptionIntoWasmAbi for TcpSocket
impl OptionIntoWasmAbi for TcpSocket
source§impl RefFromWasmAbi for TcpSocket
impl RefFromWasmAbi for TcpSocket
§type Abi = <JsValue as RefFromWasmAbi>::Abi
type Abi = <JsValue as RefFromWasmAbi>::Abi
Self
are recovered from.§type Anchor = ManuallyDrop<TcpSocket>
type Anchor = ManuallyDrop<TcpSocket>
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 TcpSocket
impl !Send for TcpSocket
impl !Sync for TcpSocket
impl Unpin for TcpSocket
impl UnwindSafe for TcpSocket
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