Struct SingletonList<T>
Represents a list with one element.
Inherited Members
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 SourceItem
The item of the list.
Declaration
public required T Item
Field Value
| Type | Description |
|---|---|
| T |
Methods
| Edit this page View SourceGetEnumerator()
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 Sourceimplicit 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. |