Table of Contents

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

value T

Properties

HasValue

public bool HasValue { get; }

Property Value

bool

IsNothing

public bool IsNothing { get; }

Property Value

bool

Value

public T Value { get; }

Property Value

T

Operators

implicit operator Maybe<T>(Nothing)

public static implicit operator Maybe<T>(Nothing nothing)

Parameters

nothing Nothing

Returns

Maybe<T>

implicit operator Maybe<T>(T)

public static implicit operator Maybe<T>(T value)

Parameters

value T

Returns

Maybe<T>