{{ self::swift_doc_block(doc, "") }}public struct {{ class_name }}: Hashable, Equatable, Sendable {
{%- for field in fields %}
{{ self::swift_doc_block(field.doc, "    ") }}    public var {{ field.swift_name }}: {{ field.swift_type }}
{%- endfor %}

    public init({% for field in fields %}{{ field.swift_name }}: {{ field.swift_type }}{% if let Some(default_expr) = field.default_expr %} = {{ default_expr }}{% endif %}{% if !loop.last %}, {% endif %}{% endfor %}) {
{%- for field in fields %}
        self.{{ field.swift_name }} = {{ field.swift_name }}
{%- endfor %}
    }

}

extension {{ class_name }}: WireCodable {
{%- if is_blittable %}
    @inlinable static func decode(from reader: inout WireReader) -> {{ class_name }} { reader.readBlittable() }
    @inlinable func encode(to writer: inout WireWriter) { writer.writeBlittable(self) }
{%- else %}
    @inlinable static func decode(from reader: inout WireReader) -> {{ class_name }} {
        {{ class_name }}({% for field in fields %}{{ field.swift_name }}: {{ field.wire_reader_decode() }}{% if !loop.last %}, {% endif %}{% endfor %})
    }
    @inlinable func encode(to writer: inout WireWriter) {
{%- for field in fields %}
        {{ field.wire_writer_encode() }}
{%- endfor %}
    }
{%- endif %}
}
