NullableSpan<T> Structure

Represents a Span<T> that may or may not have a value.

Definition

Namespace: Ookii.Common
Assembly: Ookii.Common (in Ookii.Common.dll) Version: 1.0.0+7c2900b8a16cd8ae46bdd79d8f105034712c5fa3
C#
public readonly ref struct NullableSpan<T>
Inheritance
Object    ValueType    NullableSpan<T>

Type Parameters

T
The type of the items in the Span<T>.

Constructors

NullableSpan<T> Initializes a new instance of the NullableSpan<T> structure.

Properties

HasValue Gets a value that indicates whether this instance contains a value.
Value Gets the contained value.

Methods

GetTypeGets the Type of the current instance.
(Inherited from Object)
GetValueOrDefault Returns the contained value, or the specified default value if there is no value.
GetValueOrElse Returns the contained value, or the value returned by the specified function if there is no value.
Map<TResult>(NullableSpan<T>.MapClassFunc<TResult>) Maps a NullableSpan<T> to another value by applying a function to the contained value, or returns an empty value if there is no value.
Map<TResult>(NullableSpan<T>.MapReadOnlyFunc<TResult>) Maps a NullableSpan<T> to another value by applying a function to the contained value, or returns an empty value if there is no value.
Map<TResult>(NullableSpan<T>.MapSpanFunc<TResult>) Maps a NullableSpan<T> to another value by applying a function to the contained value, or returns an empty value if there is no value.
Map<TResult>(NullableSpan<T>.MapStructFunc<TResult>) Maps a NullableSpan<T> to another value by applying a function to the contained value, or returns an empty value if there is no value.
ToString Returns a string that represents the current NullableSpan<T>.
(Overrides ValueType.ToString())
TryGetValue Gets the contained value.

Operators

Equality(NullableSpan<T>, NullableSpan<T>) Compares two NullableReadOnlySpan<T> instances for equality.
Explicit(NullableSpan<T> to Span<T>) Explicitly converts a NullableSpan<T> to a Span<T>.
Implicit(Span<T> to NullableSpan<T>) Implicitly converts a Span<T> to a NullableSpan<T>.
Inequality(NullableSpan<T>, NullableSpan<T>) Compares two NullableReadOnlySpan<T> instances for inequality.

See Also