// Generated using `moon info`, DON'T EDIT IT package "chandra/desktop/async-core" import { "moonbitlang/core/debug", } // Values pub async fn check_cancellation() -> Unit noraise pub async fn[X] handle_cancellation(async () -> X) -> X? pub fn is_being_cancelled() -> Bool pub async fn[X] protect_from_cancel(async () -> X) -> X nocancel pub async fn[X] with_task_group(async (TaskGroup[X]) -> X) -> X // Errors pub(all) suberror EndpointBusy { Read Write } pub(all) suberror FutureReadError { Cancelled Dropped } pub suberror OpCancelled { SubTaskCancelled(before_started~ : Bool) StreamReadCancelled } #derive(@debug.Debug) pub(all) suberror PromiseClosed #deprecated pub fn PromiseClosed::to_repr(Self) -> @debug.Repr #derive(@debug.Debug) pub suberror TaskCancelled #deprecated pub fn TaskCancelled::to_repr(Self) -> @debug.Repr // Types and methods pub struct CondVar { // private fields } #alias(new, deprecated) pub fn CondVar::CondVar() -> Self pub fn CondVar::broadcast(Self) -> Unit pub fn CondVar::signal(Self) -> Unit pub async fn CondVar::wait(Self) -> Unit noraise type Coroutine pub struct Future[X] { // private fields } pub async fn[X] Future::drop(Self[X]) -> Unit noraise pub fn[X] Future::drop_sync(Self[X]) -> Unit pub fn[X] Future::from(async () -> X, on_unstarted_drop? : () -> Unit) -> Self[X] pub fn[X] Future::from_source(async () -> X, async () -> Unit, () -> Unit) -> Self[X] pub async fn[X] Future::get(Self[X]) -> X pub fn[X] Future::new() -> (Self[X], Promise[X]) pub fn[X] Future::new_with_cleanup((X) -> Unit) -> (Self[X], Promise[X]) pub fn[X] Future::ready(X) -> Self[X] pub fn[X] Future::ready_with_cleanup(X, (X) -> Unit) -> Self[X] pub async fn[X] Future::reject(Self[X], (X) -> Unit) -> Unit noraise pub struct Mutex { // private fields } pub fn Mutex::Mutex() -> Self pub async fn Mutex::acquire(Self) -> Unit noraise pub fn Mutex::release(Self) -> Unit pub fn Mutex::try_acquire(Self) -> Bool pub struct Promise[X] { // private fields } pub fn[X] Promise::close(Self[X]) -> Bool pub fn[X] Promise::complete(Self[X], X) -> Bool pub fn[X] Promise::fail(Self[X], Error) -> Bool pub struct Semaphore { size : Int32 // private fields } #alias(new, deprecated) pub fn Semaphore::Semaphore(Int32, initial_value? : Int32) -> Self pub async fn Semaphore::acquire(Self) -> Unit noraise pub fn Semaphore::release(Self) -> Unit pub fn Semaphore::try_acquire(Self) -> Bool pub struct Sink[X] { // private fields } pub async fn[X] Sink::close(Self[X]) -> Unit pub fn[X] Sink::from_callbacks(async (ArrayView[X]) -> Int32, async () -> Unit, () -> Bool, ((X) -> Unit)?, Int32) -> Self[X] pub fn[X] Sink::is_open(Self[X]) -> Bool pub async fn[X] Sink::write(Self[X], ArrayView[X]) -> Int32 pub async fn[X] Sink::write_all(Self[X], ArrayView[X]) -> Bool pub async fn Sink::write_all_bytes(Self[Byte], BytesView) -> Bool pub async fn Sink::write_bytes(Self[Byte], BytesView) -> Int32 pub struct Stream[X] { // private fields } pub async fn[X] Stream::drop(Self[X]) -> Unit noraise pub fn[X] Stream::drop_sync(Self[X]) -> Unit pub fn[X] Stream::from_source(async (Int32) -> FixedArray[X]?, async () -> Unit, () -> Unit) -> Self[X] pub fn[X] Stream::new(capacity? : Int32) -> (Self[X], Sink[X]) pub fn[X] Stream::new_with_cleanup((X) -> Unit, capacity? : Int32) -> (Self[X], Sink[X]) pub fn[X] Stream::produce(async (Sink[X]) -> Unit, cleanup? : (X) -> Unit, on_unstarted_drop? : () -> Unit) -> Self[X] pub async fn[X] Stream::read(Self[X], Int32) -> FixedArray[X]? pub async fn[X] Stream::reject(Self[X], (X) -> Unit) -> Unit noraise pub fn[X] Stream::take_producer(Self[X]) -> (async (Sink[X]) -> Unit)? pub struct Task[X] { // private fields } pub fn[X] Task::cancel(Self[X]) -> Unit pub fn[X] Task::try_wait(Self[X]) -> X? raise pub async fn[X] Task::wait(Self[X]) -> X pub struct TaskGroup[X] { // private fields } pub fn[X] TaskGroup::add_defer(Self[X], async () -> Unit nocancel) -> Unit pub async fn[X] TaskGroup::return_immediately(Self[X], X) -> Unit noraise pub fn[G, X] TaskGroup::spawn(Self[G], async () -> X, no_wait? : Bool, allow_failure? : Bool) -> Task[X] pub fn[X] TaskGroup::spawn_bg(Self[X], async () -> Unit, no_wait? : Bool, allow_failure? : Bool) -> Unit #derive(Eq, Hash) type WaitableSet #deprecated pub fn WaitableSet::equal(Self, Self) -> Bool #deprecated pub fn WaitableSet::hash(Self) -> Int32 #deprecated pub fn WaitableSet::hash_combine(Self, Hasher) -> Unit #deprecated pub fn WaitableSet::not_equal(Self, Self) -> Bool // Type aliases // Traits