Skip to main content

Module events

Module events 

Source
Expand description

WebSocket subscription to Incus’s /1.0/events push-notification stream. This is an enhancement over Client::wait_for_operation, not a replacement - that method works without this events feature at all.

subscribe_events directly re-exposes the underlying WebSocket stream rather than buffering through an intermediate channel, so a slow consumer simply leaves frames unread in the transport’s own receive buffer (natural backpressure) instead of risking unbounded in-process buffering.

Structs§

EventFilter
Which event types to subscribe to. All true by default (subscribe to everything Incus emits).
EventStream
The event stream returned by Client::subscribe_events. Yields Result<Event> - a malformed frame surfaces as one Err item rather than terminating the whole stream, since one bad frame from a busy daemon shouldn’t take down an otherwise-healthy subscription.

Enums§

Event
One event from the /1.0/events stream. Lifecycle and Logging payloads stay untyped (serde_json::Value) for v1 - only Operation events are fully typed, since that’s what operation-completion tracking needs.