Struct Generator
#[repr(transparent)]
pub struct Generator<T = JsValue> { /* private fields */ }
Implementations
impl<T> Generator<T>
fn throw(&self, error: &Error) -> Result<JsValue, 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> Generator<T>
fn return_(&self, value: &T) -> JsValue where T: ErasableGenericBorrow<JsValue>,The
return()method returns the given value and finishes the generator.
impl<T> Generator<T>
fn next(&self, value: &T) -> Result<JsValue, JsValue> where T: ErasableGenericBorrow<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.
impl<T> Generator<T>
where
T: FromWasmAbi,
fn throw_value(&self, error: &JsValue) -> Result<IteratorNext<T>, JsValue> where IteratorNext<T>: ErasableGenericOwn<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> Generator<T>
where
T: FromWasmAbi,
fn try_return(&self, value: &T) -> Result<IteratorNext<T>, JsValue> where T: ErasableGenericBorrow<JsValue>, IteratorNext<T>: ErasableGenericOwn<IteratorNext<JsValue>>,The
return()method returns the given value and finishes the generator.
impl<T> Generator<T>
where
T: FromWasmAbi,
fn next_iterator(&self, value: &T) -> Result<IteratorNext<T>, JsValue> where T: ErasableGenericBorrow<JsValue>, IteratorNext<T>: ErasableGenericOwn<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 Generator
fn from(obj: JsValue) -> Self
impl<T> AsRef<Generator<T>> for Generator<T>
fn as_ref(&self) -> &Generator<T>
impl<T> AsRef<JsValue> for Generator<T>
fn as_ref(&self) -> &JsValue
impl<T> AsRef<Object> for Generator<T>
fn as_ref(&self) -> &Object
impl<T> Deref for Generator<T>
type Target = Object;fn deref(&self) -> &Object
impl<T> ErasableGeneric for Generator<T>
type Repr = JsValue;
impl<T> FromWasmAbi for Generator<T>
type Abi = <JsValue as FromWasmAbi>::Abi;unsafe fn from_abi(js: Self::Abi) -> Self
impl<T> IntoJsGeneric for Generator<T>
where
Generator<T>: JsGeneric,
type JsCanon = Generator<T>;fn to_js(self) -> Generator<T>
impl<T> IntoWasmAbi for Generator<T>
type Abi = <JsValue as IntoWasmAbi>::Abi;fn into_abi(self) -> Self::Abi
impl<T> JsCast for Generator<T>
fn instanceof(val: &JsValue) -> boolfn unchecked_from_js(val: JsValue) -> Selffn unchecked_from_js_ref(val: &JsValue) -> &Self
impl<T> LongRefFromWasmAbi for Generator<T>
type Abi = <JsValue as LongRefFromWasmAbi>::Abi;type Anchor = Generator<T>;unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor
impl<T> OptionFromWasmAbi for Generator<T>
fn is_none(abi: &Self::Abi) -> bool
impl<T> OptionIntoWasmAbi for Generator<T>
fn none() -> Self::Abi
impl<T> Promising for Generator<T>
type Resolution = Generator<T>;
impl<T> RefFromWasmAbi for Generator<T>
type Abi = <JsValue as RefFromWasmAbi>::Abi;type Anchor = ManuallyDrop<Generator<T>>;unsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor
impl<T> WasmDescribe for Generator<T>
fn describe()
impl<T, __UpcastTarget0> UpcastFrom<Generator<T>> for Generator<__UpcastTarget0>
where
__UpcastTarget0: UpcastFrom<T>,
impl<T: Clone> Clone for Generator<T>
fn clone(&self) -> Self
impl<T: Debug> Debug for Generator<T>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl<T: Eq> Eq for Generator<T>
impl<T: FromWasmAbi> Iterable for Generator<T>
type Item = T;
impl<T: PartialEq> PartialEq for Generator<T>
fn eq(&self, other: &Self) -> bool