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.

MDN documentation

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.

MDN documentation

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.

MDN documentation

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) -> bool
fn unchecked_from_js(val: JsValue) -> Self
fn 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

impl<T: PartialEq> StructuralPartialEq for AsyncGenerator<T>

Auto Trait Implementations

impl<T> Freeze for AsyncGenerator<T> where PhantomData<(T,)>: Freeze,

impl<T> RefUnwindSafe for AsyncGenerator<T> where PhantomData<(T,)>: RefUnwindSafe,

impl<T> Send for AsyncGenerator<T> where PhantomData<(T,)>: Send,

impl<T> Sync for AsyncGenerator<T> where PhantomData<(T,)>: Sync,

impl<T> Unpin for AsyncGenerator<T> where PhantomData<(T,)>: Unpin,

impl<T> UnsafeUnpin for AsyncGenerator<T> where PhantomData<(T,)>: UnsafeUnpin,

impl<T> UnwindSafe for AsyncGenerator<T> where PhantomData<(T,)>: UnwindSafe,

Blanket Implementations

impl<P, T> Receiver for AsyncGenerator<T> where P: Deref<Target = T> + ?Sized, T: ?Sized,

impl<S, T> Upcast<T> for AsyncGenerator<T> where T: UpcastFrom<S> + ?Sized, S: ?Sized,

impl<T> Any for AsyncGenerator<T> where T: 'static + ?Sized,

impl<T> Borrow<T> for AsyncGenerator<T> where T: ?Sized,

impl<T> BorrowMut<T> for AsyncGenerator<T> where T: ?Sized,

impl<T> CloneToUninit for AsyncGenerator<T> where T: Clone,

impl<T> From<T> for AsyncGenerator<T>

impl<T> JsGeneric for AsyncGenerator<T> where T: ErasableGeneric<Repr = JsValue> + UpcastFrom<T> + Upcast<JsValue> + JsCast + 'static,

impl<T> ReturnWasmAbi for AsyncGenerator<T> where T: IntoWasmAbi,

impl<T> ToOwned for AsyncGenerator<T> where T: Clone,

impl<T> TryFromJsValue for AsyncGenerator<T> where T: JsCast,

impl<T> VectorFromWasmAbi for AsyncGenerator<T> where T: ErasableGeneric<Repr = JsValue> + WasmDescribe,

impl<T> VectorIntoWasmAbi for AsyncGenerator<T> where T: ErasableGeneric<Repr = JsValue> + WasmDescribe,

impl<T> VectorRefIntoWasmAbi for AsyncGenerator<T> where &'a T: for<'a> Into<JsValue>,

impl<T, U> Into<U> for AsyncGenerator<T> where U: From<T>,

impl<T, U> TryFrom<U> for AsyncGenerator<T> where U: Into<T>,

impl<T, U> TryInto<U> for AsyncGenerator<T> where U: TryFrom<T>,