Dex.Promise
Description: Reference for Dex.Promise

### Class

# DexPromise

#### Description [src]

    final class Dex.Promise : GObject.TypeInstance
    {
      /* No available fields */
    }

`DexPromise` is a convenient `DexFuture` for prpoagating a result or rejection in appliction and library code.

Use this when there is not a more specialized `DexFuture` for your needs to propagate a result or rejection to the caller in an asynchronous fashion.

#### Hierarchy

#### Ancestors

- DexFuture
- DexObject

#### Constructors

###### dex_promise_new

No description available.

###### dex_promise_new_cancellable

Creates a new `DexPromise` that can propagate cancellation if the promise is discarded.

#### Instance methods

###### dex_promise_get_cancellable

Gets a `GCancellable` that will cancel when the promise has been discarded (and therefore result no longer necessary).

###### dex_promise_reject

Marks the promise as rejected, indicating a failure.

###### dex_promise_resolve

Sets the result for a `DexPromise`.

###### dex_promise_resolve_boolean

No description available.

###### dex_promise_resolve_double

No description available.

###### dex_promise_resolve_float

No description available.

###### dex_promise_resolve_int

No description available.

###### dex_promise_resolve_int64

No description available.

###### dex_promise_resolve_long

No description available.

###### dex_promise_resolve_object

No description available.

###### dex_promise_resolve_string

No description available.

###### dex_promise_resolve_uint

No description available.

###### dex_promise_resolve_uint64

No description available.

###### dex_promise_resolve_ulong

No description available.

###### dex_promise_resolve_variant

If `variant` is floating, its reference is consumed.

since: 0.8

##### Methods inherited from DexFuture (23)

###### dex_await

Suspends the current `DexFiber` and resumes when `future` has completed.

###### dex_await_boolean

Awaits on `future` and returns the gboolean result.

###### dex_await_boxed

Awaits on `future` and returns the `G_TYPE_BOXED` based result.

###### dex_await_double

Awaits on `future` and returns the result as an double.

###### dex_await_enum

Awaits on `future` and returns the enum result.

###### dex_await_flags

Awaits on `future` and returns the flags result.

###### dex_await_float

Awaits on `future` and returns the result as an float.

###### dex_await_int

Awaits on `future` and returns the result as an int.

###### dex_await_int64

Awaits on `future` and returns the result as an int64.

###### dex_await_object

Awaits on `future` and returns the `GObject`-based result.

###### dex_await_pointer

Calls `dex_await()` and returns the value of g_value_get_pointer(), otherwise `error` is set if the future rejected.

###### dex_await_string

Awaits on `future` and returns the string result.

###### dex_await_uint

Awaits on `future` and returns the result as an uint.

###### dex_await_uint64

Awaits on `future` and returns the result as an uint64.

###### dex_await_variant

Awaits on `future` and returns the `G_TYPE_VARIANT` based result.

since: 0.4

###### dex_future_disown

Disowns a future, allowing it to run to completion even though there may be no observer interested in the futures completion or rejection.

since: 0.4

###### dex_future_get_name

No description available.

###### dex_future_get_status

No description available.

###### dex_future_get_value

No description available.

###### dex_future_is_pending

This is a convenience function equivalent to calling `dex_future_get_status()` and checking for `DEX_FUTURE_STATUS_PENDING`.

###### dex_future_is_rejected

This is a convenience function equivalent to calling `dex_future_get_status()` and checking for `DEX_FUTURE_STATUS_REJECTED`.

###### dex_future_is_resolved

This is a convenience function equivalent to calling `dex_future_get_status()` and checking for `DEX_FUTURE_STATUS_RESOLVED`.

###### dex_future_set_static_name

Sets the name of the future with a static/internal string.

##### Methods inherited from DexObject (2)

###### dex_ref

Acquires a reference on the given object, and increases its reference count by one.

###### dex_unref

Releases a reference on the given object, and decreases its reference count by one.