struct Status A UFormError never carries success or deferred; a Deferred call reports both.
Conforms to
Hashable, Sendable, CustomStringConvertible, EquatableUFormError is the only error the SDK throws, and every method says so with throws(UFormError), so a catch reads error.status with no cast. Status has one constant per uform_status_*_k of the C interface, and its description spells it as the library does, like invalid-argument.
do {
_ = try Model.loadRam(path: "missing.safetensors")
} catch {
print(error.status, error.message) // io The checkpoint could not be opened for reading
}Scalar, Mood and every other closed set read a spelling back with init?(name:), and nil for one the library does not spell.
StatusWhat went wrong, in the vocabulary the library and every binding share - one constant per uform_status_*_k, carrying the C enumerator itself.17struct Status A UFormError never carries success or deferred; a Deferred call reports both.
Hashable, Sendable, CustomStringConvertible, EquatablesuccessThe call succeeded and carries no message.static let success: Status deferredThe call was submitted deferred and is not final yet.static let deferred: Status outOfMemoryDevice, pinned or host memory could not be allocated.static let outOfMemory: Status shapeMismatchItem counts, a pixel shape or a batch envelope disagree with the call or the model.static let shapeMismatch: Status unsupportedLayoutA stride or packing the model cannot read.static let unsupportedLayout: Status unknownKindA scalar, modality or name this build does not know.static let unknownKind: Status ioA checkpoint file could not be opened, read or written.static let io: Status deviceThe driver refused or the device faulted.static let device: Status malformedSupplied bytes could not be decoded.static let malformed: Status internalThe library reported neither success nor a failure.static let `internal`: Status configMismatchThe request contradicts a frozen configuration.static let configMismatch: Status contendedA call was refused rather than waited for - a full deferred table, or an arena serving another call.static let contended: Status cancelledA progress handler asked the call to stop; it unwound and published nothing.static let cancelled: Status unsupportedThe verb is declared, but this residency or model does not implement it.static let unsupported: Status invalidArgumentAn argument breaks the verb's contract.static let invalidArgument: Status descriptionThe status as the library spells it, like invalid-argument.initReads a spelling back, and nil for one no status carries.UFormErrorOne failed call: a status every caller can branch on, and the detail the status cannot carry.3statusThe failure identity, shared with every other SDK.let status: Status messageThe library's static detail, or this binding's own when it refused the call.let message: String descriptionThe status and message, as uform: <status>: <message>.var description: String { get }