---
source: boltffi_bindgen/src/render/csharp/templates.rs
expression: template.render().unwrap()
---
// <auto-generated>
// This file was generated by BoltFFI. Do not edit.
// </auto-generated>
#nullable enable

using System;

namespace Demo
{
    public enum LogLevel : byte
    {
        Trace = 0,
        Debug = 1,
        Info = 2,
        Warn = 3,
        Error = 4
    }

    internal static class LogLevelWire
    {
        internal const int WireEncodedSize = 4;

        internal static LogLevel Decode(WireReader reader) =>
            reader.ReadI32() switch
            {
                0 => LogLevel.Trace,
                1 => LogLevel.Debug,
                2 => LogLevel.Info,
                3 => LogLevel.Warn,
                4 => LogLevel.Error,
                int tag => throw new InvalidOperationException($"Unknown LogLevel wire tag: {tag}"),
            };

        internal static void WireEncodeTo(this LogLevel value, WireWriter wire) =>
            wire.WriteI32(value switch
            {
                LogLevel.Trace => 0,
                LogLevel.Debug => 1,
                LogLevel.Info => 2,
                LogLevel.Warn => 3,
                LogLevel.Error => 4,
                _ => throw new InvalidOperationException($"Unknown LogLevel variant: {value}"),
            });
    }
}
