[−][src]Struct js_sys::IteratorNext
The result of calling next()
on a JS iterator.
Methods
impl IteratorNext
[src]
impl IteratorNext
pub fn done(&self) -> bool
[src]
pub fn done(&self) -> bool
Has the value true
if the iterator is past the end of the iterated
sequence. In this case value optionally specifies the return value of
the iterator.
Has the value false
if the iterator was able to produce the next value
in the sequence. This is equivalent of not specifying the done property
altogether.
impl IteratorNext
[src]
impl IteratorNext
pub fn value(&self) -> JsValue
[src]
pub fn value(&self) -> JsValue
Any JavaScript value returned by the iterator. Can be omitted when done is true.
Methods from Deref<Target = JsValue>
pub const NULL: JsValue
[src]
pub const UNDEFINED: JsValue
[src]
pub const TRUE: JsValue
[src]
pub const FALSE: JsValue
[src]
pub fn as_f64(&self) -> Option<f64>
[src]
pub fn as_f64(&self) -> Option<f64>
Returns the f64
value of this JS value if it's an instance of a
number.
If this JS value is not an instance of a number then this returns
None
.
pub fn is_string(&self) -> bool
[src]
pub fn is_string(&self) -> bool
Tests whether this JS value is a JS string.
pub fn as_string(&self) -> Option<String>
[src]
pub fn as_string(&self) -> Option<String>
If this JS value is a string value, this function copies the JS string
value into wasm linear memory, encoded as UTF-8, and returns it as a
Rust String
.
To avoid the copying and re-encoding, consider the
JsString::try_from()
function from js-sys
instead.
If this JS value is not an instance of a string or if it's not valid
utf-8 then this returns None
.
pub fn as_bool(&self) -> Option<bool>
[src]
pub fn as_bool(&self) -> Option<bool>
Returns the bool
value of this JS value if it's an instance of a
boolean.
If this JS value is not an instance of a boolean then this returns
None
.
pub fn is_null(&self) -> bool
[src]
pub fn is_null(&self) -> bool
Tests whether this JS value is null
pub fn is_undefined(&self) -> bool
[src]
pub fn is_undefined(&self) -> bool
Tests whether this JS value is undefined
pub fn is_symbol(&self) -> bool
[src]
pub fn is_symbol(&self) -> bool
Tests whether the type of this JS value is symbol
pub fn is_object(&self) -> bool
[src]
pub fn is_object(&self) -> bool
Tests whether typeof self == "object" && self !== null
.
pub fn is_function(&self) -> bool
[src]
pub fn is_function(&self) -> bool
Tests whether the type of this JS value is function
.
Trait Implementations
impl AsRef<JsValue> for IteratorNext
[src]
impl AsRef<JsValue> for IteratorNext
impl From<JsValue> for IteratorNext
[src]
impl From<JsValue> for IteratorNext
fn from(obj: JsValue) -> IteratorNext
[src]
fn from(obj: JsValue) -> IteratorNext
impl From<IteratorNext> for JsValue
[src]
impl From<IteratorNext> for JsValue
fn from(obj: IteratorNext) -> JsValue
[src]
fn from(obj: IteratorNext) -> JsValue
impl Clone for IteratorNext
[src]
impl Clone for IteratorNext
fn clone(&self) -> IteratorNext
[src]
fn clone(&self) -> IteratorNext
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for IteratorNext
[src]
impl Debug for IteratorNext
impl Deref for IteratorNext
[src]
impl Deref for IteratorNext
impl WasmDescribe for IteratorNext
[src]
impl WasmDescribe for IteratorNext
impl IntoWasmAbi for IteratorNext
[src]
impl IntoWasmAbi for IteratorNext
type Abi = <JsValue as IntoWasmAbi>::Abi
The wasm ABI type that this converts into when crossing the ABI boundary. Read more
fn into_abi(self, extra: &mut dyn Stack) -> Self::Abi
[src]
fn into_abi(self, extra: &mut dyn Stack) -> Self::Abi
impl<'a> IntoWasmAbi for &'a IteratorNext
[src]
impl<'a> IntoWasmAbi for &'a IteratorNext
type Abi = <&'a JsValue as IntoWasmAbi>::Abi
The wasm ABI type that this converts into when crossing the ABI boundary. Read more
fn into_abi(self, extra: &mut dyn Stack) -> Self::Abi
[src]
fn into_abi(self, extra: &mut dyn Stack) -> Self::Abi
impl FromWasmAbi for IteratorNext
[src]
impl FromWasmAbi for IteratorNext
type Abi = <JsValue as FromWasmAbi>::Abi
The wasm ABI type that this converts from when coming back out from the ABI boundary. Read more
unsafe fn from_abi(js: Self::Abi, extra: &mut dyn Stack) -> Self
[src]
unsafe fn from_abi(js: Self::Abi, extra: &mut dyn Stack) -> Self
impl OptionFromWasmAbi for IteratorNext
[src]
impl OptionFromWasmAbi for IteratorNext
impl RefFromWasmAbi for IteratorNext
[src]
impl RefFromWasmAbi for IteratorNext
type Abi = <JsValue as RefFromWasmAbi>::Abi
The wasm ABI type references to Self
are recovered from.
type Anchor = ManuallyDrop<IteratorNext>
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
unsafe fn ref_from_abi(js: Self::Abi, extra: &mut dyn Stack) -> Self::Anchor
[src]
unsafe fn ref_from_abi(js: Self::Abi, extra: &mut dyn Stack) -> Self::Anchor
impl OptionIntoWasmAbi for IteratorNext
[src]
impl OptionIntoWasmAbi for IteratorNext
impl<'a> OptionIntoWasmAbi for &'a IteratorNext
[src]
impl<'a> OptionIntoWasmAbi for &'a IteratorNext
impl JsCast for IteratorNext
[src]
impl JsCast for IteratorNext
fn instanceof(val: &JsValue) -> bool
[src]
fn instanceof(val: &JsValue) -> bool
fn unchecked_from_js(val: JsValue) -> Self
[src]
fn unchecked_from_js(val: JsValue) -> Self
fn unchecked_from_js_ref(val: &JsValue) -> &Self
[src]
fn unchecked_from_js_ref(val: &JsValue) -> &Self
fn is_instance_of<T>(&self) -> bool where
T: JsCast,
[src]
fn is_instance_of<T>(&self) -> bool where
T: JsCast,
Test whether this JS value is an instance of the type T
. Read more
fn dyn_into<T>(self) -> Result<T, Self> where
T: JsCast,
[src]
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 more
fn dyn_ref<T>(&self) -> Option<&T> where
T: JsCast,
[src]
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 more
fn unchecked_into<T>(self) -> T where
T: JsCast,
[src]
fn unchecked_into<T>(self) -> T where
T: JsCast,
Performs a zero-cost unchecked cast into the specified type. Read more
fn unchecked_ref<T>(&self) -> &T where
T: JsCast,
[src]
fn unchecked_ref<T>(&self) -> &T where
T: JsCast,
Performs a zero-cost unchecked cast into a reference to the specified type. Read more
Auto Trait Implementations
impl !Send for IteratorNext
impl !Send for IteratorNext
impl !Sync for IteratorNext
impl !Sync for IteratorNext
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
impl<T> ReturnWasmAbi for T where
T: IntoWasmAbi,
[src]
impl<T> ReturnWasmAbi for T where
T: IntoWasmAbi,
type Abi = <T as IntoWasmAbi>::Abi
Same as IntoWasmAbi::Abi
fn return_abi(self, extra: &mut dyn Stack) -> <T as ReturnWasmAbi>::Abi
[src]
fn return_abi(self, extra: &mut dyn Stack) -> <T as ReturnWasmAbi>::Abi