Skip to main content

Crate kio

Crate kio 

Source
Expand description

Producer/consumer shared state with async waker-based notification.

This crate provides Producer and Consumer types that share state through a mutex-protected value. Producers can modify the state and consumers are automatically notified via async wakers. The channel auto-closes when all producers are dropped.

For state that both sides legitimately mutate (e.g. a reverse request queue), Shared is a role-less sibling: every handle can lock, read, or park on a predicate, with no liveness of its own.

Structs§

Closed
The channel closed before the awaited condition held.
Consumer
The consuming side of a shared state channel.
ConsumerWeak
A weak handle from the consuming side (Consumer::weak).
Mut
A mutable guard over the shared state.
Pending
Adapts a Pollable into a Future, retaining the strong Waiter between polls so its weak registration stays live.
Producer
The producing side of a shared state channel.
ProducerWeak
A weak handle from the producing side (Producer::weak).
Ref
A read-only guard over the shared state.
Shared
A cloneable, lock-guarded value with waker notification.
Waiter
Handle passed to poll functions for registering with WaiterLists.
WaiterList
A list of weak wakers waiting for notification.

Traits§

Pollable
A pollable computation backed by kio channels.

Functions§

wait
Create a Future from a poll function that receives a Waiter.