Show / Hide Table of Contents

Struct SingletonList<T>

Represents a list with one element.

Implements
IReadOnlyList<T>
IList<T>
ICollection<T>
ITuple
IReadOnlySet<T>
IReadOnlyCollection<T>
IEnumerable<T>
IEnumerable
IAsyncEnumerable<T>
Inherited Members
ValueType.Equals(object)
ValueType.GetHashCode()
ValueType.ToString()
object.Equals(object, object)
object.GetType()
object.ReferenceEquals(object, object)
Namespace: DotNext.Collections.Specialized
Assembly: DotNext.dll
Syntax
public struct SingletonList<T> : IReadOnlyList<T>, IList<T>, ICollection<T>, ITuple, IReadOnlySet<T>, IReadOnlyCollection<T>, IEnumerable<T>, IEnumerable, IAsyncEnumerable<T>
Type Parameters
Name Description
T

The type of the element in the list.

Fields

| Edit this page View Source

Item

The item of the list.

Declaration
public required T Item
Field Value
Type Description
T

Methods

| Edit this page View Source

GetEnumerator()

Gets enumerator for the single element in the list.

Declaration
public readonly SingletonList<T>.Enumerator GetEnumerator()
Returns
Type Description
SingletonList<T>.Enumerator

The enumerator over single element.

Operators

| Edit this page View Source

implicit operator SingletonList<T>(T)

Converts a value to the read-only list.

Declaration
public static implicit operator SingletonList<T>(T item)
Parameters
Type Name Description
T item

The item in the list.

Returns
Type Description
SingletonList<T>

The collection containing the list.

Implements

IReadOnlyList<T>
IList<T>
ICollection<T>
ITuple
IReadOnlySet<T>
IReadOnlyCollection<T>
IEnumerable<T>
IEnumerable
IAsyncEnumerable<T>

Extension Methods

BasicExtensions.IsBetween<T, TLowerBound, TUpperBound>(T, TLowerBound, TUpperBound)
BasicExtensions.IsOneOf<T>(T, ReadOnlySpan<T>)
Collection.ToAsyncEnumerator<TEnumerator, T>(TEnumerator, CancellationToken)
Collection.ToClassicEnumerator<TEnumerator, T>(TEnumerator)
Enumerator.Skip<TEnumerator, T>(ref TEnumerator, int)
ExpressionBuilder.Const<T>(T)
TupleExtensions.ToArray<T>(T)
AsyncEnumerable.CopyAsync<T>(IAsyncEnumerable<T>, int, MemoryAllocator<T>?, CancellationToken)
AsyncEnumerable.ElementAtAsync<T>(IAsyncEnumerable<T>, int, CancellationToken)
AsyncEnumerable.FirstOrNoneAsync<T>(IAsyncEnumerable<T>, Predicate<T>, CancellationToken)
AsyncEnumerable.FirstOrNoneAsync<T>(IAsyncEnumerable<T>, CancellationToken)
AsyncEnumerable.ForEachAsync<T>(IAsyncEnumerable<T>, Action<T>, CancellationToken)
AsyncEnumerable.ForEachAsync<T>(IAsyncEnumerable<T>, Func<T, CancellationToken, ValueTask>, CancellationToken)
AsyncEnumerable.LastOrNoneAsync<T>(IAsyncEnumerable<T>, CancellationToken)
AsyncEnumerable.ToArrayAsync<T>(IAsyncEnumerable<T>, int, MemoryAllocator<T>?, CancellationToken)
Collection.AddAll<T>(ICollection<T>, IEnumerable<T>)
Collection.Append<T>(IEnumerable<T>, params T[])
Collection.Copy<T>(IEnumerable<T>, int, MemoryAllocator<T>?)
Collection.ElementAt<T>(IEnumerable<T>, int, out T)
Collection.FirstOrNone<T>(IEnumerable<T>)
Collection.ForEachAsync<T>(IEnumerable<T>, Func<T, CancellationToken, ValueTask>, CancellationToken)
Collection.ForEach<T>(IEnumerable<T>, Action<T>)
Collection.LastOrNone<T>(IEnumerable<T>)
Collection.Prepend<T>(IEnumerable<T>, params T[])
Collection.SequenceHashCode<T>(IEnumerable<T>, bool)
Collection.ToAsyncEnumerable<T>(IEnumerable<T>)
Collection.ToString<T>(IEnumerable<T>, string, string)
Enumerator.GetAsyncEnumerator<T>(IEnumerable<T>, CancellationToken)
List.IndexerGetter<T>(IList<T>)
List.IndexerSetter<T>(IList<T>)
List.InsertOrdered<T>(IList<T>, T, delegate*<T?, T?, int>)
List.InsertOrdered<T>(IList<T>, T, Comparison<T?>)
List.InsertOrdered<T, TComparer>(IList<T>, T, TComparer)
List.Insert<T>(IList<T>, Index, T)
List.RemoveAt<T>(IList<T>, Index)
List.Slice<T>(IList<T>, Range)
List.ToArray<TInput, TOutput>(IList<TInput>, delegate*<TInput, TOutput>)
List.ToArray<TInput, TOutput>(IList<TInput>, delegate*<TInput, TOutput>)
List.ToArray<TInput, TOutput>(IList<TInput>, Converter<TInput, TOutput>)
List.ToArray<TInput, TOutput>(IList<TInput>, Func<int, TInput, TOutput>)
Collection.Convert<TInput, TOutput>(IReadOnlyCollection<TInput>, Converter<TInput, TOutput>)
List.Convert<TInput, TOutput>(IReadOnlyList<TInput>, Converter<TInput, TOutput>)
List.IndexerGetter<T>(IReadOnlyList<T>)
  • Edit this page
  • View Source
☀
☾
In this article
Back to top
Supported by the .NET Foundation
☀
☾