FabricAvailability

sealed interface FabricAvailability

Whether a Loom's underlying transport fabric can be attempted on this runtime. A fabric scoped out by target (e.g. WebRTC only present on wasmJs) is simply absent — not Unavailable. Unavailable means present-but-not-usable-now.

Samples

val loom = InMemoryLoom()
when (val avail = loom.availability()) {
    is FabricAvailability.Available -> { /* ready to weave */ }
    is FabricAvailability.Unavailable -> error("Fabric not usable: ${avail.reason}")
    is FabricAvailability.Unknown -> { /* best-effort: attempt anyway, surface avail.reason */ }
}

Inheritors

Types

Link copied to clipboard
Link copied to clipboard
data class Unavailable(val reason: String) : FabricAvailability
Link copied to clipboard
data class Unknown(val reason: String) : FabricAvailability

The fabric may or may not be usable — the platform cannot report ground truth right now (e.g. iOS gives no Wi-Fi SSID; a Local-Network permission has not yet been probed). Distinct from a target-scoped-out fabric, which is simply absent. Best-effort consumers should surface reason rather than assume Available or Unavailable.