API reference

Capability Protocol

Extends AnyObject, Sendable
A protocol for capabilities that can be attached to a DeviceSession.
Capabilities represent device features (e.g., streaming, display) that are managed by a parent DeviceSession. When the parent session stops, it cascades stop() to all attached capabilities.
start() is intentionally not part of this protocol because different capabilities may have different start signatures. The protocol exists for DeviceSession's cascading stop contract.

Signature

protocol Capability: AnyObject, Sendable

Properties

capabilityState : CapabilityState
[Get]
The current state of this capability.

Functions

stop ()
Stops the capability, tearing down its resources and detaching from the parent DeviceSession.
Signature
public func stop()