---
source: boltffi_bindgen/src/render/swift/templates.rs
assertion_line: 768
expression: "render_enum(&e, \"\")"
---
public enum ByteStatus: UInt8, Hashable, Sendable, CaseIterable {
    case idle = 0
    case running = 255

    @usableFromInline init(fromC c: UInt8) { self = ByteStatus(rawValue: c)! }
    @usableFromInline var cValue: UInt8 { rawValue }
    @usableFromInline init(wireTag: Int32) {
        switch wireTag {
        case 0: self = .idle
        case 1: self = .running
        default: fatalError("Invalid ByteStatus wire tag: \(wireTag)")
        }
    }
    @usableFromInline var wireTag: Int32 {
        switch rawValue {
        case 0: return 0
        case 255: return 1
        default: fatalError("Invalid ByteStatus raw value: \(rawValue)")
        }
    }

}

extension ByteStatus: WireCodable {
    @inlinable static func decode(from reader: inout WireReader) -> ByteStatus { ByteStatus(wireTag: reader.readI32()) }
    @inlinable func encode(to writer: inout WireWriter) { writer.writeI32(wireTag) }
}
