Struct Maybe<T>
- Namespace
- Glitch9.IO.Networking
Ensures a value is assigned only once. This prevents redundant reassignment attempts in scenarios where the value remains null, optimizing performance by eliminating unnecessary checks or operations.
public readonly struct Maybe<T>
Type Parameters
T
- Inherited Members
- Extension Methods
Constructors
Maybe(T)
public Maybe(T value)
Parameters
valueT
Properties
HasValue
public bool HasValue { get; }
Property Value
IsNothing
public bool IsNothing { get; }
Property Value
Value
public T Value { get; }
Property Value
- T
Operators
implicit operator Maybe<T>(Nothing)
public static implicit operator Maybe<T>(Nothing nothing)
Parameters
nothingNothing
Returns
- Maybe<T>
implicit operator Maybe<T>(T)
public static implicit operator Maybe<T>(T value)
Parameters
valueT
Returns
- Maybe<T>