Std

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

Bottom.cs (3578B)


      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 System;
      9 using System.Diagnostics;
     10 using System.Runtime.InteropServices;
     11 #region Namespaces
     12 namespace Std {
     13     #region Types
     14     [StructLayout(LayoutKind.Explicit, CharSet = CharSet.Unicode, Pack = 1, Size = 1)]
     15     public readonly struct Bottom: ISum, IClone<Bottom>, IEquality<Bottom>, IError, IHashable, IInto<Bottom>, IInto<string>, IOrd<Bottom> {
     16 
     17         #region Type-level Constructors
     18         #endregion
     19 
     20         #region Instance Constructors
     21         public Bottom () => throw new InvalidOperationException(_exception);
     22         #endregion
     23 
     24         #region Type-level Fields
     25         const string _exception = "Std.Bottom represents the Bottom type which has no terms; thus it MUST be impossible to create instances of it.";
     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 Bottom Clone() => throw new InvalidOperationException(_exception);
     42         public readonly Ordering Cmp(in Bottom _) => throw new InvalidOperationException(_exception);
     43         public readonly bool Equals(in Bottom _) => throw new InvalidOperationException(_exception);
     44         public override readonly bool Equals(object? _) => throw new InvalidOperationException(_exception);
     45         public override readonly int GetHashCode() => throw new InvalidOperationException(_exception);
     46         public readonly Unit Hash<THasher>(ref THasher _) where THasher: notnull, IHasher => throw new InvalidOperationException(_exception);
     47         public readonly Bottom Into() => throw new InvalidOperationException(_exception);
     48         public readonly Bottom IntoBottom() => Into();
     49         public readonly string IntoString() => ToString();
     50         readonly string IInto<string>.Into() => IntoString();
     51         public readonly Maybe<Ordering> PartialCmp(in Bottom _) => throw new InvalidOperationException(_exception);
     52         public readonly Maybe<IError> Source() => throw new InvalidOperationException(_exception);
     53         public readonly Maybe<StackTrace> StackTrace() => throw new InvalidOperationException(_exception);
     54         public override readonly string ToString() => throw new InvalidOperationException(_exception);
     55         readonly Result<Bottom, Bottom> ITryInto<Bottom, Bottom>.TryInto() => throw new InvalidOperationException(_exception);
     56         readonly Result<string, Bottom> ITryInto<string, Bottom>.TryInto() => throw new InvalidOperationException(_exception);
     57         #endregion
     58 
     59         #region Operators
     60         public static bool operator !=(Bottom _, Bottom _1) => throw new InvalidOperationException(_exception);
     61         public static bool operator <(Bottom _, Bottom _1) => throw new InvalidOperationException(_exception);
     62         public static bool operator <=(Bottom _, Bottom _1) => throw new InvalidOperationException(_exception);
     63         public static bool operator ==(Bottom _, Bottom _1) => throw new InvalidOperationException(_exception);
     64         public static bool operator >(Bottom _, Bottom _1) => throw new InvalidOperationException(_exception);
     65         public static bool operator >=(Bottom _, Bottom _1) => throw new InvalidOperationException(_exception);
     66         #endregion
     67 
     68         #region Types
     69         #endregion
     70     }
     71     #endregion
     72 
     73     #region Namespaces
     74     #endregion
     75 }
     76 #endregion