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§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