Member group
Single
Declaring type: Operators
Module: System.Linq
Assembly: System.Runtime.dll
Overloads / Variants
Single
func Single<T>(predicate: (T) -> bool) -> Result<T, SingleError>
Extension from Operators.Single
Parameters
| Name | Type | Description |
|---|---|---|
self |
Iterable<T> | |
predicate |
Function |
Return value
Result<T, SingleError>
Single
func Single<T>() -> Result<T, SingleError>
Extension from Operators.Single
Returns the sole matching element, or SingleError.Empty or SingleError.Multiple for a cardinality mismatch.
Parameters
| Name | Type | Description |
|---|---|---|
self |
Iterable<T> | The source outcome or iterable on which the extension operates. |
Return value
Result<T, SingleError>