Struct web_sys::TcpSocket [−][src]
#[repr(transparent)]pub struct TcpSocket { /* fields omitted */ }
Expand description
The TcpSocket class.
This API requires the following crate features to be activated: TcpSocket
Implementations
Getter for the host field of this object.
This API requires the following crate features to be activated: TcpSocket
Getter for the port field of this object.
This API requires the following crate features to be activated: TcpSocket
Getter for the ssl field of this object.
This API requires the following crate features to be activated: TcpSocket
Getter for the bufferedAmount field of this object.
This API requires the following crate features to be activated: TcpSocket
Getter for the readyState field of this object.
This API requires the following crate features to be activated: TcpReadyState, TcpSocket
Getter for the binaryType field of this object.
This API requires the following crate features to be activated: TcpSocket, TcpSocketBinaryType
Getter for the onopen field of this object.
This API requires the following crate features to be activated: TcpSocket
Setter for the onopen field of this object.
This API requires the following crate features to be activated: TcpSocket
Getter for the ondrain field of this object.
This API requires the following crate features to be activated: TcpSocket
Setter for the ondrain field of this object.
This API requires the following crate features to be activated: TcpSocket
Getter for the ondata field of this object.
This API requires the following crate features to be activated: TcpSocket
Setter for the ondata field of this object.
This API requires the following crate features to be activated: TcpSocket
Getter for the onerror field of this object.
This API requires the following crate features to be activated: TcpSocket
Setter for the onerror field of this object.
This API requires the following crate features to be activated: TcpSocket
Getter for the onclose field of this object.
This API requires the following crate features to be activated: TcpSocket
Setter for the onclose field of this object.
This API requires the following crate features to be activated: TcpSocket
pub 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
The close() method.
This API requires the following crate features to be activated: TcpSocket
The send() method.
This API requires the following crate features to be activated: TcpSocket
The send() method.
This API requires the following crate features to be activated: TcpSocket
pub 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
pub 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
The suspend() method.
This API requires the following crate features to be activated: TcpSocket
The upgradeToSecure() method.
This API requires the following crate features to be activated: TcpSocket
Methods from Deref<Target = EventTarget>
The addEventListener() method.
This API requires the following crate features to be activated: EventTarget
pub fn add_event_listener_with_event_listener(
&self,
type_: &str,
listener: &EventListener
) -> Result<(), JsValue>
pub fn add_event_listener_with_event_listener(
&self,
type_: &str,
listener: &EventListener
) -> Result<(), JsValue>
The addEventListener() method.
This API requires the following crate features to be activated: EventListener, EventTarget
pub fn add_event_listener_with_callback_and_add_event_listener_options(
&self,
type_: &str,
listener: &Function,
options: &AddEventListenerOptions
) -> Result<(), JsValue>
pub fn add_event_listener_with_callback_and_add_event_listener_options(
&self,
type_: &str,
listener: &Function,
options: &AddEventListenerOptions
) -> Result<(), JsValue>
The addEventListener() method.
This API requires the following crate features to be activated: AddEventListenerOptions, EventTarget
pub fn add_event_listener_with_event_listener_and_add_event_listener_options(
&self,
type_: &str,
listener: &EventListener,
options: &AddEventListenerOptions
) -> Result<(), JsValue>
pub fn add_event_listener_with_event_listener_and_add_event_listener_options(
&self,
type_: &str,
listener: &EventListener,
options: &AddEventListenerOptions
) -> Result<(), JsValue>
The addEventListener() method.
This API requires the following crate features to be activated: AddEventListenerOptions, EventListener, EventTarget
The addEventListener() method.
This API requires the following crate features to be activated: EventTarget
pub fn add_event_listener_with_event_listener_and_bool(
&self,
type_: &str,
listener: &EventListener,
options: bool
) -> Result<(), JsValue>
pub fn add_event_listener_with_event_listener_and_bool(
&self,
type_: &str,
listener: &EventListener,
options: bool
) -> Result<(), JsValue>
The addEventListener() method.
This API requires the following crate features to be activated: EventListener, EventTarget
pub fn add_event_listener_with_callback_and_add_event_listener_options_and_wants_untrusted(
&self,
type_: &str,
listener: &Function,
options: &AddEventListenerOptions,
wants_untrusted: Option<bool>
) -> Result<(), JsValue>
pub fn add_event_listener_with_callback_and_add_event_listener_options_and_wants_untrusted(
&self,
type_: &str,
listener: &Function,
options: &AddEventListenerOptions,
wants_untrusted: Option<bool>
) -> Result<(), JsValue>
The addEventListener() method.
This API requires the following crate features to be activated: AddEventListenerOptions, EventTarget
pub fn add_event_listener_with_event_listener_and_add_event_listener_options_and_wants_untrusted(
&self,
type_: &str,
listener: &EventListener,
options: &AddEventListenerOptions,
wants_untrusted: Option<bool>
) -> Result<(), JsValue>
pub fn add_event_listener_with_event_listener_and_add_event_listener_options_and_wants_untrusted(
&self,
type_: &str,
listener: &EventListener,
options: &AddEventListenerOptions,
wants_untrusted: Option<bool>
) -> Result<(), JsValue>
The addEventListener() method.
This API requires the following crate features to be activated: AddEventListenerOptions, EventListener, EventTarget
The addEventListener() method.
This API requires the following crate features to be activated: EventTarget
pub fn add_event_listener_with_event_listener_and_bool_and_wants_untrusted(
&self,
type_: &str,
listener: &EventListener,
options: bool,
wants_untrusted: Option<bool>
) -> Result<(), JsValue>
pub fn add_event_listener_with_event_listener_and_bool_and_wants_untrusted(
&self,
type_: &str,
listener: &EventListener,
options: bool,
wants_untrusted: Option<bool>
) -> Result<(), JsValue>
The addEventListener() method.
This API requires the following crate features to be activated: EventListener, EventTarget
The dispatchEvent() method.
This API requires the following crate features to be activated: Event, EventTarget
The removeEventListener() method.
This API requires the following crate features to be activated: EventTarget
pub fn remove_event_listener_with_event_listener(
&self,
type_: &str,
listener: &EventListener
) -> Result<(), JsValue>
pub fn remove_event_listener_with_event_listener(
&self,
type_: &str,
listener: &EventListener
) -> Result<(), JsValue>
The removeEventListener() method.
This API requires the following crate features to be activated: EventListener, EventTarget
pub fn remove_event_listener_with_callback_and_event_listener_options(
&self,
type_: &str,
listener: &Function,
options: &EventListenerOptions
) -> Result<(), JsValue>
pub fn remove_event_listener_with_callback_and_event_listener_options(
&self,
type_: &str,
listener: &Function,
options: &EventListenerOptions
) -> Result<(), JsValue>
The removeEventListener() method.
This API requires the following crate features to be activated: EventListenerOptions, EventTarget
pub fn remove_event_listener_with_event_listener_and_event_listener_options(
&self,
type_: &str,
listener: &EventListener,
options: &EventListenerOptions
) -> Result<(), JsValue>
pub fn remove_event_listener_with_event_listener_and_event_listener_options(
&self,
type_: &str,
listener: &EventListener,
options: &EventListenerOptions
) -> Result<(), JsValue>
The removeEventListener() method.
This API requires the following crate features to be activated: EventListener, EventListenerOptions, EventTarget
The removeEventListener() method.
This API requires the following crate features to be activated: EventTarget
pub fn remove_event_listener_with_event_listener_and_bool(
&self,
type_: &str,
listener: &EventListener,
options: bool
) -> Result<(), JsValue>
pub fn remove_event_listener_with_event_listener_and_bool(
&self,
type_: &str,
listener: &EventListener,
options: bool
) -> Result<(), JsValue>
The removeEventListener() method.
This API requires the following crate features to be activated: EventListener, EventTarget
Trait Implementations
Performs the conversion.
type Target = EventTarget
type Target = EventTarget
The resulting type after dereferencing.
Dereferences the value.
Performs the conversion.
Performs a dynamic instanceof check to see whether the JsValue
provided is an instance of this type. Read more
Performs a zero-cost unchecked conversion from a JsValue into an
instance of Self Read more
Performs a zero-cost unchecked conversion from a &JsValue into an
instance of &Self. Read more
Test whether this JS value has a type T. Read more
Performs a dynamic cast (checked at runtime) of this value into the
target type T. Read more
Performs a dynamic cast (checked at runtime) of this value into the
target type T. Read more
Performs a zero-cost unchecked cast into the specified type. Read more
Performs a zero-cost unchecked cast into a reference to the specified type. Read more
Test whether this JS value is an instance of the type T. Read more
Performs a dynamic check to see whether the JsValue provided
is a value of this type. Read more
type Abi = <JsValue as RefFromWasmAbi>::Abi
type Abi = <JsValue as RefFromWasmAbi>::Abi
The wasm ABI type references to Self are recovered from.
type Anchor = ManuallyDrop<TcpSocket>
type Anchor = ManuallyDrop<TcpSocket>
The type that holds the reference to 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 more
Recover a Self::Anchor from Self::Abi. Read more
Auto Trait Implementations
impl RefUnwindSafe for TcpSocket
impl UnwindSafe for TcpSocket
Blanket Implementations
Mutably borrows from an owned value. Read more
type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as IntoWasmAbi::Abi
Same as IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err. Read more