Struct web_sys::EventSource
source · #[repr(transparent)]pub struct EventSource { /* private fields */ }
Expand description
The EventSource
object
This API requires the following crate features to be activated: EventSource
Implementations§
source§impl EventSource
impl EventSource
source§impl EventSource
impl EventSource
sourcepub fn new_with_event_source_init_dict(
url: &str,
event_source_init_dict: &EventSourceInit
) -> Result<EventSource, JsValue>
pub fn new_with_event_source_init_dict(
url: &str,
event_source_init_dict: &EventSourceInit
) -> Result<EventSource, JsValue>
The new EventSource(..)
constructor, creating a new instance of EventSource
This API requires the following crate features to be activated: EventSource
, EventSourceInit
source§impl EventSource
impl EventSource
source§impl EventSource
impl EventSource
source§impl EventSource
impl EventSource
sourcepub fn with_credentials(&self) -> bool
pub fn with_credentials(&self) -> bool
The withCredentials
getter
This API requires the following crate features to be activated: EventSource
source§impl EventSource
impl EventSource
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: EventSource
source§impl EventSource
impl EventSource
source§impl EventSource
impl EventSource
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: EventSource
source§impl EventSource
impl EventSource
source§impl EventSource
impl EventSource
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: EventSource
source§impl EventSource
impl EventSource
source§impl EventSource
impl EventSource
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: EventSource
source§impl EventSource
impl EventSource
pub const CONNECTING: u16 = 0u16
Trait Implementations§
source§impl AsRef<EventTarget> for EventSource
impl AsRef<EventTarget> for EventSource
source§fn as_ref(&self) -> &EventTarget
fn as_ref(&self) -> &EventTarget
Converts this type into a shared reference of the (usually inferred) input type.
source§impl AsRef<JsValue> for EventSource
impl AsRef<JsValue> for EventSource
source§impl AsRef<Object> for EventSource
impl AsRef<Object> for EventSource
source§impl Clone for EventSource
impl Clone for EventSource
source§fn clone(&self) -> EventSource
fn clone(&self) -> EventSource
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for EventSource
impl Debug for EventSource
source§impl From<EventSource> for EventTarget
impl From<EventSource> for EventTarget
source§fn from(obj: EventSource) -> EventTarget
fn from(obj: EventSource) -> EventTarget
Converts to this type from the input type.
source§impl From<EventSource> for JsValue
impl From<EventSource> for JsValue
source§fn from(obj: EventSource) -> JsValue
fn from(obj: EventSource) -> JsValue
Converts to this type from the input type.
source§impl From<EventSource> for Object
impl From<EventSource> for Object
source§fn from(obj: EventSource) -> Object
fn from(obj: EventSource) -> Object
Converts to this type from the input type.
source§impl From<JsValue> for EventSource
impl From<JsValue> for EventSource
source§fn from(obj: JsValue) -> EventSource
fn from(obj: JsValue) -> EventSource
Converts to this type from the input type.
source§impl FromWasmAbi for EventSource
impl FromWasmAbi for EventSource
source§impl<'a> IntoWasmAbi for &'a EventSource
impl<'a> IntoWasmAbi for &'a EventSource
source§impl IntoWasmAbi for EventSource
impl IntoWasmAbi for EventSource
source§impl JsCast for EventSource
impl JsCast for EventSource
source§fn instanceof(val: &JsValue) -> bool
fn instanceof(val: &JsValue) -> bool
Performs a dynamic
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,
Test whether this JS value is an instance of the type
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,
Performs a dynamic cast (checked at runtime) of this value into the
target type
T
. Read moresource§fn dyn_ref<T>(&self) -> Option<&T>where
T: JsCast,
fn dyn_ref<T>(&self) -> Option<&T>where
T: JsCast,
Performs a dynamic cast (checked at runtime) of this value into the
target type
T
. Read moresource§fn unchecked_into<T>(self) -> Twhere
T: JsCast,
fn unchecked_into<T>(self) -> Twhere
T: JsCast,
Performs a zero-cost unchecked cast into the specified type. Read more
source§impl OptionFromWasmAbi for EventSource
impl OptionFromWasmAbi for EventSource
source§impl<'a> OptionIntoWasmAbi for &'a EventSource
impl<'a> OptionIntoWasmAbi for &'a EventSource
source§impl OptionIntoWasmAbi for EventSource
impl OptionIntoWasmAbi for EventSource
source§impl RefFromWasmAbi for EventSource
impl RefFromWasmAbi for EventSource
§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<EventSource>
type Anchor = ManuallyDrop<EventSource>
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 moreAuto Trait Implementations§
impl RefUnwindSafe for EventSource
impl Send for EventSource
impl Sync for EventSource
impl Unpin for EventSource
impl UnwindSafe for EventSource
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
Same as
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
Same as
IntoWasmAbi::into_abi
, except that it may throw and never
return in the case of Err
. Read more