Struct AsyncGenerator
#[repr(transparent)]
pub struct AsyncGenerator<T = JsValue> { /* private fields */ }
Implementations
impl<T> AsyncGenerator<T>
fn return_(&self, value: &T) -> Result<Promise<IteratorNext<T>>, JsValue> where T: ErasableGenericBorrow<JsValue>, Promise<IteratorNext<T>>: ErasableGenericOwn<Promise<IteratorNext<JsValue>>>,The
return()method returns the given value and finishes the generator.
impl<T> AsyncGenerator<T>
fn throw(&self, error: &JsValue) -> Result<Promise<IteratorNext<T>>, JsValue> where Promise<IteratorNext<T>>: ErasableGenericOwn<Promise<IteratorNext<JsValue>>>,The
throw()method resumes the execution of a generator by throwing an error into it and returns an object with two properties done and value.
impl<T> AsyncGenerator<T>
fn next(&self, value: &T) -> Result<Promise<IteratorNext<T>>, JsValue> where T: ErasableGenericBorrow<JsValue>, Promise<IteratorNext<T>>: ErasableGenericOwn<Promise<IteratorNext<JsValue>>>,The
next()method returns an object with two properties done and value. You can also provide a parameter to the next method to send a value to the generator.
Trait Implementations
impl From<JsValue> for AsyncGenerator
fn from(obj: JsValue) -> Self
impl<T> AsRef<AsyncGenerator<T>> for AsyncGenerator<T>
fn as_ref(&self) -> &AsyncGenerator<T>
impl<T> AsRef<JsValue> for AsyncGenerator<T>
fn as_ref(&self) -> &JsValue
impl<T> AsRef<Object> for AsyncGenerator<T>
fn as_ref(&self) -> &Object
impl<T> Deref for AsyncGenerator<T>
type Target = Object;fn deref(&self) -> &Object
impl<T> ErasableGeneric for AsyncGenerator<T>
type Repr = JsValue;
impl<T> FromWasmAbi for AsyncGenerator<T>
type Abi = <JsValue as FromWasmAbi>::Abi;unsafe fn from_abi(js: Self::Abi) -> Self
impl<T> IntoJsGeneric for AsyncGenerator<T>
where
AsyncGenerator<T>: JsGeneric,
type JsCanon = AsyncGenerator<T>;fn to_js(self) -> AsyncGenerator<T>
impl<T> IntoWasmAbi for AsyncGenerator<T>
type Abi = <JsValue as IntoWasmAbi>::Abi;fn into_abi(self) -> Self::Abi
impl<T> JsCast for AsyncGenerator<T>
fn instanceof(val: &JsValue) -> boolfn unchecked_from_js(val: JsValue) -> Selffn unchecked_from_js_ref(val: &JsValue) -> &Self
impl<T> LongRefFromWasmAbi for AsyncGenerator<T>
type Abi = <JsValue as LongRefFromWasmAbi>::Abi;type Anchor = AsyncGenerator<T>;unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor
impl<T> OptionFromWasmAbi for AsyncGenerator<T>
fn is_none(abi: &Self::Abi) -> bool
impl<T> OptionIntoWasmAbi for AsyncGenerator<T>
fn none() -> Self::Abi
impl<T> Promising for AsyncGenerator<T>
type Resolution = AsyncGenerator<T>;
impl<T> RefFromWasmAbi for AsyncGenerator<T>
type Abi = <JsValue as RefFromWasmAbi>::Abi;type Anchor = ManuallyDrop<AsyncGenerator<T>>;unsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor
impl<T> WasmDescribe for AsyncGenerator<T>
fn describe()
impl<T, __UpcastTarget0> UpcastFrom<AsyncGenerator<T>> for AsyncGenerator<__UpcastTarget0>
where
__UpcastTarget0: UpcastFrom<T>,
impl<T: Clone> Clone for AsyncGenerator<T>
fn clone(&self) -> Self
impl<T: Debug> Debug for AsyncGenerator<T>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl<T: Eq> Eq for AsyncGenerator<T>
impl<T: FromWasmAbi> AsyncIterable for AsyncGenerator<T>
type Item = T;
impl<T: PartialEq> PartialEq for AsyncGenerator<T>
fn eq(&self, other: &Self) -> bool