Struct AsyncIterator

#[repr(transparent)]
pub struct AsyncIterator<T = JsValue> { /* private fields */ }

Any object that conforms to the JS async iterator protocol. For example, something returned by myObject[Symbol.asyncIterator]().

MDN documentation

Implementations

impl<T> AsyncIterator<T>

fn next(&self) -> Result<Promise, JsValue>

The next() method always has to return a Promise which resolves to an object with appropriate properties including done and value. If a non-object value gets returned (such as false or undefined), a TypeError ("iterator.next() returned a non-object value") will be thrown.

impl<T> AsyncIterator<T> where T: FromWasmAbi,

fn next_iterator(&self) -> Result<Promise<IteratorNext<T>>, JsValue>
where
    Promise<IteratorNext<T>>: ErasableGenericOwn<Promise<IteratorNext<JsValue>>>,

The next() method always has to return a Promise which resolves to an object with appropriate properties including done and value. If a non-object value gets returned (such as false or undefined), a TypeError ("iterator.next() returned a non-object value") will be thrown.

Trait Implementations

impl From<JsValue> for AsyncIterator

fn from(obj: JsValue) -> Self

impl<T> AsRef<AsyncIterator<T>> for AsyncIterator<T>

fn as_ref(&self) -> &AsyncIterator<T>

impl<T> AsRef<JsValue> for AsyncIterator<T>

fn as_ref(&self) -> &JsValue

impl<T> AsyncIterable for AsyncIterator<T>

type Item = T;

impl<T> Deref for AsyncIterator<T>

type Target = JsValue;
fn deref(&self) -> &JsValue

impl<T> ErasableGeneric for AsyncIterator<T>

type Repr = JsValue;

impl<T> FromWasmAbi for AsyncIterator<T>

type Abi = <JsValue as FromWasmAbi>::Abi;
unsafe fn from_abi(js: Self::Abi) -> Self

impl<T> IntoJsGeneric for AsyncIterator<T> where AsyncIterator<T>: JsGeneric,

type JsCanon = AsyncIterator<T>;
fn to_js(self) -> AsyncIterator<T>

impl<T> IntoWasmAbi for AsyncIterator<T>

type Abi = <JsValue as IntoWasmAbi>::Abi;
fn into_abi(self) -> Self::Abi

impl<T> JsCast for AsyncIterator<T>

fn instanceof(val: &JsValue) -> bool
fn is_type_of(val: &JsValue) -> bool
fn unchecked_from_js(val: JsValue) -> Self
fn unchecked_from_js_ref(val: &JsValue) -> &Self

impl<T> LongRefFromWasmAbi for AsyncIterator<T>

type Abi = <JsValue as LongRefFromWasmAbi>::Abi;
type Anchor = AsyncIterator<T>;
unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor

impl<T> OptionFromWasmAbi for AsyncIterator<T>

fn is_none(abi: &Self::Abi) -> bool

impl<T> OptionIntoWasmAbi for AsyncIterator<T>

fn none() -> Self::Abi

impl<T> Promising for AsyncIterator<T>

type Resolution = AsyncIterator<T>;

impl<T> RefFromWasmAbi for AsyncIterator<T>

type Abi = <JsValue as RefFromWasmAbi>::Abi;
type Anchor = ManuallyDrop<AsyncIterator<T>>;
unsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor

impl<T> WasmDescribe for AsyncIterator<T>

fn describe()

impl<T, __UpcastTarget0> UpcastFrom<AsyncIterator<T>> for AsyncIterator<__UpcastTarget0> where __UpcastTarget0: UpcastFrom<T>,

impl<T: Clone> Clone for AsyncIterator<T>

fn clone(&self) -> Self

impl<T: Debug> Debug for AsyncIterator<T>

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Auto Trait Implementations

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

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

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

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

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

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

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

Blanket Implementations

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

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

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

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

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

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

impl<T> From<T> for AsyncIterator<T>

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

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

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

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

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

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

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

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

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

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