---
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 readonly record struct BoundaryError(
        int Lo,
        int Hi
    )
    {
        internal static BoundaryError Decode(WireReader reader) =>
            new BoundaryError(
                reader.ReadI32(),
                reader.ReadI32()
            );

        internal int WireEncodedSize() =>
            4 +
            4;

        internal void WireEncodeTo(WireWriter wire)
        {
            wire.WriteI32(this.Lo);
            wire.WriteI32(this.Hi);
        }
    }
    /// <summary>
    /// Thrown by generated wrapper methods when the Rust side returns
    /// a <c>BoundaryError</c> as the error. The original value is
    /// exposed through <c>Error</c>; the inherited <c>Message</c>
    /// derives from it (forwarded from a <c>Message</c> field when the
    /// wrapped type has one, otherwise the value's <c>ToString()</c>).
    /// </summary>
    public sealed class BoundaryErrorException : Exception
    {
        public BoundaryError Error { get; }

        public BoundaryErrorException(BoundaryError error) : base(error.ToString())
        {
            Error = error;
        }
    }
}
