---
source: boltffi_bindgen/src/render/swift/templates.rs
expression: render_enum(&e, "")
---
public enum SearchResult: Hashable, Equatable, Sendable {
    case found(String)
    case notFound

}

extension SearchResult: WireCodable {
    @inlinable static func decode(from reader: inout WireReader) -> SearchResult {
        let tag = reader.readI32()
        switch tag {
        case 0:
            return .found(reader.readString())
        case 1:
            return .notFound
        default:
            fatalError("Invalid SearchResult tag: \(tag)")
        }
    }

    @inlinable func encode(to writer: inout WireWriter) {
        switch self {
        case let .found(value):
            writer.writeI32(0)
            writer.writeString(0)
        case .notFound:
            writer.writeI32(1)
        }
    }
}
