/* libdex-1.vapi generated by vapigen, do not modify. */

[CCode (cprefix = "Dex", gir_namespace = "Dex", gir_version = "1", lower_case_cprefix = "dex_")]
namespace Dex {
	[CCode (cheader_filename = "libdex.h", has_type_id = false)]
	[Compact]
	public class AioContext {
	}
	[CCode (cheader_filename = "libdex.h", type_id = "dex_async_pair_get_type ()")]
	public sealed class AsyncPair : Dex.Future {
		[CCode (has_construct_function = false, type = "DexFuture*")]
		public AsyncPair (void* instance, Dex.AsyncPairInfo info);
		public unowned GLib.Cancellable get_cancellable ();
		public void return_boolean (bool value);
		public void return_error (owned GLib.Error error);
		public void return_int64 (int64 value);
		public void return_object (owned GLib.Object instance);
		public void return_string (owned string? value);
		public void return_uint64 (uint64 value);
		public void return_variant (owned GLib.Variant variant);
		[Version (since = "0.4")]
		public void set_cancel_on_discard (bool cancel_on_discard);
	}
	[CCode (cheader_filename = "libdex.h", type_id = "dex_async_result_get_type ()")]
	public sealed class AsyncResult : GLib.Object, GLib.AsyncResult {
		[CCode (has_construct_function = false)]
		public async AsyncResult (void* source_object, GLib.Cancellable? cancellable);
		public void await (owned Dex.Future future);
		public Dex.Future? dup_future ();
		public unowned string get_name ();
		public bool propagate_boolean () throws GLib.Error;
		public double propagate_double () throws GLib.Error;
		public ssize_t propagate_int () throws GLib.Error;
		public void* propagate_pointer () throws GLib.Error;
		public void set_name (string name);
		public void set_priority (int priority);
		public void set_static_name (string name);
	}
	[CCode (cheader_filename = "libdex.h", type_id = "dex_block_get_type ()")]
	public sealed class Block : Dex.Future {
		[CCode (has_construct_function = false)]
		protected Block ();
		public Dex.BlockKind get_kind ();
		public unowned Dex.Scheduler get_scheduler ();
	}
	[CCode (cheader_filename = "libdex.h", type_id = "dex_cancellable_get_type ()")]
	public sealed class Cancellable : Dex.Future {
		[CCode (has_construct_function = false)]
		public Cancellable ();
		public void cancel ();
		[CCode (has_construct_function = false, type = "DexFuture*")]
		public Cancellable.from_cancellable (GLib.Cancellable? cancellable = null);
	}
	[CCode (cheader_filename = "libdex.h", type_id = "dex_channel_get_type ()")]
	public sealed class Channel : Dex.Object {
		[CCode (has_construct_function = false)]
		public Channel (uint capacity);
		public bool can_receive ();
		public bool can_send ();
		public void close_receive ();
		public void close_send ();
		public Dex.Future receive ();
		public Dex.Future receive_all ();
		public Dex.Future send (owned Dex.Future future);
	}
	[CCode (cheader_filename = "libdex.h", type_id = "dex_delayed_get_type ()")]
	public sealed class Delayed : Dex.Future {
		[CCode (has_construct_function = false, type = "DexFuture*")]
		public Delayed (Dex.Future future);
		public Dex.Future? dup_future ();
		public void release ();
	}
	[CCode (cheader_filename = "libdex.h", type_id = "dex_fiber_get_type ()")]
	public sealed class Fiber : Dex.Future {
		[CCode (has_construct_function = false)]
		protected Fiber ();
	}
	[CCode (cheader_filename = "libdex.h", copy_function = "g_boxed_copy", free_function = "g_boxed_free", type_id = "dex_file_info_list_get_type ()")]
	[Compact]
	public class FileInfoList {
	}
	[CCode (cheader_filename = "libdex.h", type_id = "dex_future_get_type ()")]
	public class Future : Dex.Object {
		[CCode (has_construct_function = false)]
		protected Future ();
		[CCode (cname = "dex_future_all_racev", has_construct_function = false)]
		public Future.all_racev ([CCode (array_length_cname = "n_futures", array_length_pos = 1.1, array_length_type = "guint")] Dex.Future[] futures);
		[CCode (cname = "dex_future_allv", has_construct_function = false)]
		public Future.allv ([CCode (array_length_cname = "n_futures", array_length_pos = 1.1, array_length_type = "guint")] Dex.Future[] futures);
		[CCode (cname = "dex_future_anyv", has_construct_function = false)]
		public Future.anyv ([CCode (array_length_cname = "n_futures", array_length_pos = 1.1, array_length_type = "guint")] Dex.Future[] futures);
		[CCode (cname = "dex_await")]
		[DestroysInstance]
		public bool await () throws GLib.Error;
		[CCode (cname = "dex_await_boolean")]
		[DestroysInstance]
		public bool await_boolean () throws GLib.Error;
		[CCode (cname = "dex_await_boxed")]
		[DestroysInstance]
		public void* await_boxed () throws GLib.Error;
		[CCode (cname = "dex_await_double")]
		[DestroysInstance]
		public double await_double () throws GLib.Error;
		[CCode (cname = "dex_await_enum")]
		[DestroysInstance]
		public uint await_enum () throws GLib.Error;
		[CCode (cname = "dex_await_fd")]
		[DestroysInstance]
		public int await_fd () throws GLib.Error;
		[CCode (cname = "dex_await_flags")]
		[DestroysInstance]
		public uint await_flags () throws GLib.Error;
		[CCode (cname = "dex_await_float")]
		[DestroysInstance]
		public float await_float () throws GLib.Error;
		[CCode (cname = "dex_await_int")]
		[DestroysInstance]
		public int await_int () throws GLib.Error;
		[CCode (cname = "dex_await_int64")]
		[DestroysInstance]
		public int64 await_int64 () throws GLib.Error;
		[CCode (cname = "dex_await_object")]
		[DestroysInstance]
		public GLib.Object await_object () throws GLib.Error;
		[CCode (cname = "dex_await_pointer")]
		[DestroysInstance]
		public void* await_pointer () throws GLib.Error;
		[CCode (cname = "dex_await_string")]
		[DestroysInstance]
		public string? await_string () throws GLib.Error;
		[CCode (cname = "dex_await_uint")]
		[DestroysInstance]
		public uint await_uint () throws GLib.Error;
		[CCode (cname = "dex_await_uint64")]
		[DestroysInstance]
		public uint64 await_uint64 () throws GLib.Error;
		[CCode (cname = "dex_await_variant")]
		[DestroysInstance]
		[Version (since = "0.4")]
		public GLib.Variant await_variant () throws GLib.Error;
		[CCode (cname = "dex_future_catch", has_construct_function = false)]
		public Future.@catch (owned Dex.Future future, owned Dex.FutureCallback callback);
		[CCode (cname = "dex_future_catch_loop", has_construct_function = false)]
		public Future.catch_loop (owned Dex.Future future, owned Dex.FutureCallback callback);
		[DestroysInstance]
		[Version (since = "0.4")]
		public void disown ();
		[CCode (cname = "dex_future_finally", has_construct_function = false)]
		public Future.@finally (owned Dex.Future future, owned Dex.FutureCallback callback);
		[CCode (cname = "dex_future_finally_loop", has_construct_function = false)]
		public Future.finally_loop (owned Dex.Future future, owned Dex.FutureCallback callback);
		[CCode (cname = "dex_future_firstv", has_construct_function = false)]
		public Future.firstv ([CCode (array_length_cname = "n_futures", array_length_pos = 1.1, array_length_type = "guint")] Dex.Future[] futures);
		[CCode (has_construct_function = false)]
		public Future.for_boolean (bool v_bool);
		[CCode (has_construct_function = false)]
		public Future.for_double (double v_double);
		[CCode (has_construct_function = false)]
		[Version (since = "0.4")]
		public Future.for_errno (int errno_);
		[CCode (has_construct_function = false)]
		public Future.for_error (owned GLib.Error error);
		[CCode (has_construct_function = false)]
		public Future.for_fd (int fd);
		[CCode (has_construct_function = false)]
		public Future.for_float (float v_float);
		[CCode (has_construct_function = false)]
		public Future.for_int (int v_int);
		[CCode (has_construct_function = false)]
		public Future.for_int64 (int64 v_int64);
		[CCode (has_construct_function = false)]
		public Future.for_object (GLib.Object value);
		[CCode (has_construct_function = false)]
		public Future.for_pointer (void* pointer);
		[CCode (has_construct_function = false)]
		public Future.for_string (string string);
		[CCode (has_construct_function = false)]
		public Future.for_uint (uint v_uint);
		[CCode (has_construct_function = false)]
		public Future.for_uint64 (uint64 v_uint64);
		[CCode (has_construct_function = false)]
		public Future.for_value (GLib.Value value);
		public unowned string get_name ();
		public Dex.FutureStatus get_status ();
		public unowned GLib.Value? get_value () throws GLib.Error;
		[CCode (has_construct_function = false)]
		[Version (since = "0.4")]
		public Future.infinite ();
		public bool is_pending ();
		public bool is_rejected ();
		public bool is_resolved ();
		[CCode (has_construct_function = false)]
		public Future.take_object (owned GLib.Object? value);
		[CCode (has_construct_function = false)]
		public Future.take_string (owned string string);
		[CCode (cname = "dex_future_then", has_construct_function = false)]
		public Future.then (owned Dex.Future future, owned Dex.FutureCallback callback);
		[CCode (cname = "dex_future_then_loop", has_construct_function = false)]
		public Future.then_loop (owned Dex.Future future, owned Dex.FutureCallback callback);
	}
	[CCode (cheader_filename = "libdex.h", type_id = "dex_future_set_get_type ()")]
	public sealed class FutureSet : Dex.Future {
		[CCode (has_construct_function = false)]
		protected FutureSet ();
		public unowned Dex.Future get_future_at (uint position);
		public uint get_size ();
		public unowned GLib.Value? get_value_at (uint position) throws GLib.Error;
	}
	[CCode (cheader_filename = "libdex.h", copy_function = "g_boxed_copy", free_function = "g_boxed_free", type_id = "dex_inet_address_list_get_type ()")]
	[Compact]
	public class InetAddressList {
	}
	[CCode (cheader_filename = "libdex.h", type_id = "dex_main_scheduler_get_type ()")]
	public sealed class MainScheduler : Dex.Scheduler {
		[CCode (has_construct_function = false)]
		protected MainScheduler ();
	}
	[CCode (cheader_filename = "libdex.h", ref_function = "dex_ref", type_id = "dex_object_get_type ()", unref_function = "dex_unref")]
	public abstract class Object {
		[CCode (has_construct_function = false)]
		protected Object ();
		[CCode (cname = "dex_ref")]
		public Dex.Object @ref ();
		[CCode (cname = "dex_unref")]
		[DestroysInstance]
		public void unref ();
	}
	[CCode (cheader_filename = "libdex.h", type_id = "dex_promise_get_type ()")]
	public sealed class Promise : Dex.Future {
		[CCode (has_construct_function = false)]
		public Promise ();
		[CCode (has_construct_function = false)]
		public Promise.cancellable ();
		public unowned GLib.Cancellable? get_cancellable ();
		public void reject (owned GLib.Error error);
		public void resolve (GLib.Value value);
		public void resolve_boolean (bool value);
		[Version (since = "0.10")]
		public void resolve_boxed (GLib.Type boxed_type, owned void* instance);
		public void resolve_double (double value);
		public void resolve_fd (int fd);
		public void resolve_float (float value);
		public void resolve_int (int value);
		public void resolve_int64 (int64 value);
		public void resolve_long (long value);
		public void resolve_object (owned GLib.Object? object);
		public void resolve_string (owned string value);
		public void resolve_uint (uint value);
		public void resolve_uint64 (uint64 value);
		public void resolve_ulong (long value);
		[Version (since = "0.8")]
		public void resolve_variant (owned GLib.Variant? variant);
	}
	[CCode (cheader_filename = "libdex.h", type_id = "dex_scheduler_get_type ()")]
	public abstract class Scheduler : Dex.Object {
		[CCode (has_construct_function = false)]
		protected Scheduler ();
		public static unowned Dex.Scheduler get_default ();
		public unowned GLib.MainContext get_main_context ();
		public static unowned Dex.Scheduler? get_thread_default ();
		public void push ([CCode (scope = "async")] Dex.SchedulerFunc func);
		public static Dex.Scheduler? ref_thread_default ();
		public Dex.Future spawn (size_t stack_size, owned Dex.FiberFunc func);
	}
	[CCode (cheader_filename = "libdex.h", type_id = "dex_static_future_get_type ()")]
	public sealed class StaticFuture : Dex.Future {
		[CCode (has_construct_function = false)]
		protected StaticFuture ();
	}
	[CCode (cheader_filename = "libdex.h", type_id = "dex_thread_pool_scheduler_get_type ()")]
	public sealed class ThreadPoolScheduler : Dex.Scheduler {
		[CCode (has_construct_function = false, type = "DexScheduler*")]
		public ThreadPoolScheduler ();
		public static unowned Dex.Scheduler get_default ();
	}
	[CCode (cheader_filename = "libdex.h", type_id = "dex_timeout_get_type ()")]
	public sealed class Timeout : Dex.Future {
		[CCode (has_construct_function = false)]
		protected Timeout ();
		[CCode (has_construct_function = false, type = "DexFuture*")]
		public Timeout.deadline (int64 deadline);
		[CCode (has_construct_function = false, type = "DexFuture*")]
		public Timeout.msec (int msec);
		public void postpone_until (int64 deadline);
		[CCode (has_construct_function = false, type = "DexFuture*")]
		public Timeout.seconds (int seconds);
		[CCode (has_construct_function = false, type = "DexFuture*")]
		public Timeout.usec (int64 usec);
	}
	[CCode (cheader_filename = "libdex.h", type_id = "dex_unix_signal_get_type ()")]
	public sealed class UnixSignal : Dex.Future {
		[CCode (has_construct_function = false, type = "DexFuture*")]
		public UnixSignal (int signum);
		public int get_signum ();
	}
	[CCode (cheader_filename = "libdex.h", has_type_id = false)]
	public struct AsyncPairInfo {
		public void* @async;
		public void* finish;
		public GLib.Type return_type;
	}
	[CCode (cheader_filename = "libdex.h", cprefix = "DEX_BLOCK_KIND_", type_id = "dex_block_kind_get_type ()")]
	public enum BlockKind {
		THEN,
		CATCH,
		FINALLY
	}
	[CCode (cheader_filename = "libdex.h", cprefix = "DEX_FUTURE_STATUS_", type_id = "dex_future_status_get_type ()")]
	public enum FutureStatus {
		PENDING,
		RESOLVED,
		REJECTED
	}
	[CCode (cheader_filename = "libdex.h", cprefix = "DEX_ERROR_", has_type_id = false)]
	public errordomain Error {
		UNKNOWN,
		CHANNEL_CLOSED,
		DEPENDENCY_FAILED,
		FIBER_EXITED,
		NO_FIBER,
		PENDING,
		SEMAPHORE_CLOSED,
		TIMED_OUT,
		TYPE_MISMATCH,
		TYPE_NOT_SUPPORTED,
		FIBER_CANCELLED;
		public static GLib.Quark quark ();
	}
	[CCode (cheader_filename = "libdex.h", instance_pos = 0.9)]
	public delegate Dex.Future? FiberFunc ();
	[CCode (cheader_filename = "libdex.h", instance_pos = 1.9)]
	public delegate Dex.Future? FutureCallback (Dex.Future future);
	[CCode (cheader_filename = "libdex.h", instance_pos = 0.9)]
	public delegate void SchedulerFunc ();
	[CCode (cheader_filename = "libdex.h")]
	public static Dex.Future aio_read (Dex.AioContext aio_context, int fd, [CCode (array_length_cname = "count", array_length_pos = 3.5, array_length_type = "gsize")] out unowned uint8[] buffer, int64 offset);
	[CCode (cheader_filename = "libdex.h")]
	public static Dex.Future aio_write (Dex.AioContext aio_context, int fd, [CCode (array_length_cname = "count", array_length_pos = 3.5, array_length_type = "gsize")] uint8[] buffer, int64 offset);
	[CCode (cheader_filename = "libdex.h")]
	[Version (since = "0.4")]
	public static Dex.Future bus_get (GLib.BusType bus_type);
	[CCode (cheader_filename = "libdex.h")]
	[Version (since = "0.4")]
	public static Dex.Future dbus_connection_call (GLib.DBusConnection connection, string? bus_name, string object_path, string interface_name, string method_name, GLib.Variant? parameters, GLib.VariantType? reply_type, GLib.DBusCallFlags flags, int timeout_msec);
	[CCode (cheader_filename = "libdex.h")]
	[Version (since = "0.4")]
	public static Dex.Future dbus_connection_call_with_unix_fd_list (GLib.DBusConnection connection, string? bus_name, string object_path, string interface_name, string method_name, GLib.Variant? parameters, GLib.VariantType? reply_type, GLib.DBusCallFlags flags, int timeout_msec, GLib.UnixFDList? fd_list);
	[CCode (cheader_filename = "libdex.h")]
	[Version (since = "0.4")]
	public static Dex.Future dbus_connection_send_message_with_reply (GLib.DBusConnection connection, GLib.DBusMessage message, GLib.DBusSendMessageFlags flags, int timeout_msec, out uint32 out_serial);
	[CCode (cheader_filename = "libdex.h")]
	public static Dex.Future file_copy (GLib.File source, GLib.File destination, GLib.FileCopyFlags flags, int io_priority);
	[CCode (cheader_filename = "libdex.h")]
	public static Dex.Future file_delete (GLib.File file, int io_priority);
	[CCode (cheader_filename = "libdex.h")]
	public static Dex.Future file_enumerate_children (GLib.File file, string attributes, GLib.FileQueryInfoFlags flags, int io_priority);
	[CCode (cheader_filename = "libdex.h")]
	public static Dex.Future file_enumerator_next_files (GLib.FileEnumerator file_enumerator, int num_files, int io_priority);
	[CCode (cheader_filename = "libdex.h")]
	public static Dex.Future file_load_contents_bytes (GLib.File file);
	[CCode (cheader_filename = "libdex.h")]
	public static Dex.Future file_make_directory (GLib.File file, int io_priority);
	[CCode (cheader_filename = "libdex.h")]
	[Version (since = "0.6")]
	public static Dex.Future file_query_exists (GLib.File file);
	[CCode (cheader_filename = "libdex.h")]
	public static Dex.Future file_query_info (GLib.File file, string attributes, GLib.FileQueryInfoFlags flags, int io_priority);
	[CCode (cheader_filename = "libdex.h")]
	public static Dex.Future file_read (GLib.File file, int io_priority);
	[CCode (cheader_filename = "libdex.h")]
	public static Dex.Future file_replace (GLib.File file, string? etag, bool make_backup, GLib.FileCreateFlags flags, int io_priority);
	[CCode (cheader_filename = "libdex.h")]
	public static Dex.Future file_replace_contents_bytes (GLib.File file, GLib.Bytes contents, string? etag, bool make_backup, GLib.FileCreateFlags flags);
	[CCode (cheader_filename = "libdex.h")]
	public static size_t get_min_stack_size ();
	[CCode (cheader_filename = "libdex.h")]
	public static size_t get_page_size ();
	[CCode (cheader_filename = "libdex.h")]
	public static void init ();
	[CCode (cheader_filename = "libdex.h")]
	public static Dex.Future input_stream_close (GLib.InputStream self, int io_priority);
	[CCode (cheader_filename = "libdex.h")]
	public static Dex.Future input_stream_read (GLib.InputStream self, [CCode (array_length_cname = "count", array_length_pos = 2.5, array_length_type = "gsize")] out unowned uint8[] buffer, int io_priority);
	[CCode (cheader_filename = "libdex.h")]
	public static Dex.Future input_stream_read_bytes (GLib.InputStream self, size_t count, int io_priority);
	[CCode (cheader_filename = "libdex.h")]
	public static Dex.Future input_stream_skip (GLib.InputStream self, size_t count, int io_priority);
	[CCode (cheader_filename = "libdex.h")]
	public static Dex.Future io_stream_close (GLib.IOStream io_stream, int io_priority);
	[CCode (cheader_filename = "libdex.h")]
	public static Dex.Future output_stream_close (GLib.OutputStream self, int io_priority);
	[CCode (cheader_filename = "libdex.h")]
	public static Dex.Future output_stream_splice (GLib.OutputStream output, GLib.InputStream input, GLib.OutputStreamSpliceFlags flags, int io_priority);
	[CCode (cheader_filename = "libdex.h")]
	public static Dex.Future output_stream_write (GLib.OutputStream self, [CCode (array_length_cname = "count", array_length_pos = 2.5, array_length_type = "gsize")] uint8[] buffer, int io_priority);
	[CCode (cheader_filename = "libdex.h")]
	public static Dex.Future output_stream_write_bytes (GLib.OutputStream self, GLib.Bytes bytes, int io_priority);
	[CCode (cheader_filename = "libdex.h")]
	public static Dex.Future resolver_lookup_by_name (GLib.Resolver resolver, string address);
	[CCode (cheader_filename = "libdex.h")]
	public static Dex.Future socket_client_connect (GLib.SocketClient socket_client, GLib.SocketConnectable socket_connectable);
	[CCode (cheader_filename = "libdex.h")]
	public static Dex.Future socket_listener_accept (GLib.SocketListener listener);
	[CCode (cheader_filename = "libdex.h")]
	[Version (since = "0.4")]
	public static Dex.Future subprocess_wait_check (GLib.Subprocess subprocess);
	[CCode (cheader_filename = "libdex.h")]
	[Version (since = "0.4")]
	public static unowned Dex.Object? value_get_object (GLib.Value value);
	[CCode (cheader_filename = "libdex.h")]
	[Version (since = "0.4")]
	public static void value_set_object (GLib.Value value, Dex.Object? object);
	[CCode (cheader_filename = "libdex.h")]
	[Version (since = "0.4")]
	public static void value_take_object (GLib.Value value, owned Dex.Object? object);
}
