Struct quickjs_runtime::quickjs_utils::promises::PromiseRef
source · [−]pub struct PromiseRef { /* private fields */ }
Implementations
sourceimpl PromiseRef
impl PromiseRef
pub fn get_promise_obj_ref(&self) -> JSValueRef
pub fn resolve_q(
&self,
q_ctx: &QuickJsRealmAdapter,
value: JSValueRef
) -> Result<(), JsError>
sourcepub unsafe fn resolve(
&self,
context: *mut JSContext,
value: JSValueRef
) -> Result<(), JsError>
pub unsafe fn resolve(
&self,
context: *mut JSContext,
value: JSValueRef
) -> Result<(), JsError>
Safety
When passing a context pointer please make sure the corresponding QuickJsContext is still valid
pub fn reject_q(
&self,
q_ctx: &QuickJsRealmAdapter,
value: JSValueRef
) -> Result<(), JsError>
Trait Implementations
sourceimpl Clone for PromiseRef
impl Clone for PromiseRef
sourceimpl JsPromiseAdapter<QuickJsRealmAdapter> for PromiseRef
impl JsPromiseAdapter<QuickJsRealmAdapter> for PromiseRef
sourcefn js_promise_resolve(
&self,
context: &QuickJsRealmAdapter,
resolution: &JSValueRef
) -> Result<(), JsError>
fn js_promise_resolve(
&self,
context: &QuickJsRealmAdapter,
resolution: &JSValueRef
) -> Result<(), JsError>
resolve this JsPromiseAdapter
sourcefn js_promise_reject(
&self,
context: &QuickJsRealmAdapter,
rejection: &JSValueRef
) -> Result<(), JsError>
fn js_promise_reject(
&self,
context: &QuickJsRealmAdapter,
rejection: &JSValueRef
) -> Result<(), JsError>
reject this JsPromiseAdapter
sourcefn js_promise_get_value(&self, _realm: &QuickJsRealmAdapter) -> JSValueRef
fn js_promise_get_value(&self, _realm: &QuickJsRealmAdapter) -> JSValueRef
get the JsValueAdapter for this Promise
Auto Trait Implementations
impl RefUnwindSafe for PromiseRef
impl !Send for PromiseRef
impl !Sync for PromiseRef
impl Unpin for PromiseRef
impl UnwindSafe for PromiseRef
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more