Std

Mainly a port of Rust's std.
git clone https://git.philomathiclife.com/repos/Std
Log | Files | Refs | README

TryIntoIntError.cs (2377B)


      1 using Std.Clone;
      2 using Std.Cmp;
      3 using Std.Convert;
      4 using Std.Error;
      5 using Std.Hashing;
      6 using Std.Maybe;
      7 using Std.Result;
      8 using static Std.Result.Result<Std.Num.TryIntoIntError, Std.Bottom>;
      9 using System.Diagnostics;
     10 using System.Runtime.InteropServices;
     11 #region Namespaces
     12 namespace Std.Num {
     13     #region Types
     14     [StructLayout(LayoutKind.Explicit, CharSet = CharSet.Unicode, Pack = 1, Size = 1)]
     15     public readonly struct TryIntoIntError: IClone<TryIntoIntError>, IEquality<TryIntoIntError>, IError, IHashable, IInto<TryIntoIntError> {
     16 
     17         #region Type-level Constructors
     18         #endregion
     19 
     20         #region Instance Constructors
     21         public TryIntoIntError(){}
     22         #endregion
     23 
     24         #region Type-level Fields
     25         public static readonly TryIntoIntError Overflow = new();
     26         #endregion
     27 
     28         #region Instance Fields
     29         #endregion
     30 
     31         #region Type-level Properties
     32         #endregion
     33 
     34         #region Instance Properties
     35         #endregion
     36 
     37         #region Type-level Functions
     38         #endregion
     39 
     40         #region Instance Functions
     41         public readonly TryIntoIntError Clone() => this;
     42         public readonly bool Equals(in TryIntoIntError _) => true;
     43         public override readonly bool Equals(object? _) => false;
     44         public override readonly int GetHashCode() => 0;
     45         public readonly Unit Hash<THasher>(ref THasher _) where THasher: notnull, IHasher => new Unit();
     46         public readonly TryIntoIntError Into() => this;
     47         public readonly string IntoString() => ToString();
     48         readonly string IInto<string>.Into() => IntoString();
     49         public readonly Maybe<IError> Source() => Maybe<IError>.None();
     50         public readonly Maybe<StackTrace> StackTrace() => Maybe<StackTrace>.None();
     51         public override readonly string ToString() => "Overflow";
     52         readonly Result<TryIntoIntError, Bottom> ITryInto<TryIntoIntError, Bottom>.TryInto() => OK(this);
     53         readonly Result<string, Bottom> ITryInto<string, Bottom>.TryInto() => new(ToString());
     54         #endregion
     55 
     56         #region Operators
     57         public static bool operator !=(TryIntoIntError _, TryIntoIntError _1) => false;
     58         public static bool operator ==(TryIntoIntError _, TryIntoIntError _1) => true;
     59         #endregion
     60 
     61         #region Types
     62         #endregion
     63     }
     64     #endregion
     65 
     66     #region Namespaces
     67     #endregion
     68 }
     69 #endregion