pub struct ResolveablePromise<'js> {
pub promise: Promise<'js>,
/* private fields */
}Fields§
§promise: Promise<'js>Implementations§
Source§impl<'js> ResolveablePromise<'js>
impl<'js> ResolveablePromise<'js>
pub fn new(ctx: &Ctx<'js>) -> Result<Self>
pub fn resolved_with_undefined(primordials: &PromisePrimordials<'js>) -> Self
pub fn rejected_with( primordials: &PromisePrimordials<'js>, error: Value<'js>, ) -> Result<Self>
pub fn rejected_with_constructor( primordials: &PromisePrimordials<'js>, constructor: &Constructor<'js>, msg: &str, ) -> Result<Self>
pub fn resolve(&self, value: impl IntoArg<'js>) -> Result<()>
pub fn resolve_undefined(&self) -> Result<()>
pub fn reject(&self, value: impl IntoArg<'js>) -> Result<()>
pub fn reject_with_constructor( &self, constructor: &Constructor<'js>, msg: &str, ) -> Result<()>
pub fn is_pending(&self) -> bool
pub fn set_is_handled(&self) -> Result<()>
Trait Implementations§
Source§impl<'js> Clone for ResolveablePromise<'js>
impl<'js> Clone for ResolveablePromise<'js>
Source§fn clone(&self) -> ResolveablePromise<'js>
fn clone(&self) -> ResolveablePromise<'js>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'js> Debug for ResolveablePromise<'js>
impl<'js> Debug for ResolveablePromise<'js>
Source§impl<'js> JsLifetime<'js> for ResolveablePromise<'js>
impl<'js> JsLifetime<'js> for ResolveablePromise<'js>
Source§type Changed<'to> = ResolveablePromise<'to>
type Changed<'to> = ResolveablePromise<'to>
The target which has the same type as a
Self but with another lifetime 'tAuto Trait Implementations§
impl<'js> !Send for ResolveablePromise<'js>
impl<'js> !Sync for ResolveablePromise<'js>
impl<'js> !UnwindSafe for ResolveablePromise<'js>
impl<'js> Freeze for ResolveablePromise<'js>
impl<'js> RefUnwindSafe for ResolveablePromise<'js>
impl<'js> Unpin for ResolveablePromise<'js>
impl<'js> UnsafeUnpin for ResolveablePromise<'js>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more