docs: Move the GAsyncInitable SECTION

Move the contents to the struct docs.

Helps: #3037
This commit is contained in:
Matthias Clasen 2023-09-25 21:11:13 -04:00 committed by Philip Withnall
parent 840cfd1ab7
commit 331c137ee1
2 changed files with 13 additions and 19 deletions

View File

@ -29,27 +29,26 @@
/** /**
* SECTION:gasyncinitable * GAsyncInitable:
* @short_description: Asynchronously failable object initialization interface
* @include: gio/gio.h
* @see_also: #GInitable
* *
* This is the asynchronous version of #GInitable; it behaves the same * `GAsyncInitable` is an interface for asynchronously initializable objects.
*
* This is the asynchronous version of [struct@Gio.Initable]; it behaves the same
* in all ways except that initialization is asynchronous. For more details * in all ways except that initialization is asynchronous. For more details
* see the descriptions on #GInitable. * see the descriptions on `GInitable`.
* *
* A class may implement both the #GInitable and #GAsyncInitable interfaces. * A class may implement both the `GInitable` and `GAsyncInitable` interfaces.
* *
* Users of objects implementing this are not intended to use the interface * Users of objects implementing this are not intended to use the interface
* method directly; instead it will be used automatically in various ways. * method directly; instead it will be used automatically in various ways.
* For C applications you generally just call g_async_initable_new_async() * For C applications you generally just call [func@Gio.AsyncInitiable.new_async]
* directly, or indirectly via a foo_thing_new_async() wrapper. This will call * directly, or indirectly via a foo_thing_new_async() wrapper. This will call
* g_async_initable_init_async() under the cover, calling back with %NULL and * [func@Gio.AsyncInitable.init_async] under the covers, calling back with `NULL`
* a set %GError on failure. * and a set `GError` on failure.
* *
* A typical implementation might look something like this: * A typical implementation might look something like this:
* *
* |[<!-- language="C" --> * ```c
* enum { * enum {
* NOT_INITIALIZED, * NOT_INITIALIZED,
* INITIALIZING, * INITIALIZING,
@ -132,7 +131,9 @@
* iface->init_async = foo_init_async; * iface->init_async = foo_init_async;
* iface->init_finish = foo_init_finish; * iface->init_finish = foo_init_finish;
* } * }
* ]| * ```
*
* Since: 2.22
*/ */
static void g_async_initable_real_init_async (GAsyncInitable *initable, static void g_async_initable_real_init_async (GAsyncInitable *initable,

View File

@ -38,13 +38,6 @@ G_BEGIN_DECLS
#define G_ASYNC_INITABLE_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_ASYNC_INITABLE, GAsyncInitableIface)) #define G_ASYNC_INITABLE_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_ASYNC_INITABLE, GAsyncInitableIface))
#define G_TYPE_IS_ASYNC_INITABLE(type) (g_type_is_a ((type), G_TYPE_ASYNC_INITABLE)) #define G_TYPE_IS_ASYNC_INITABLE(type) (g_type_is_a ((type), G_TYPE_ASYNC_INITABLE))
/**
* GAsyncInitable:
*
* Interface for asynchronously initializable objects.
*
* Since: 2.22
**/
typedef struct _GAsyncInitableIface GAsyncInitableIface; typedef struct _GAsyncInitableIface GAsyncInitableIface;
/** /**