Class ResultCollectionExtensions
Extension methods for working with collections involving Result<T, TErr>.
Inherited Members
Namespace: RustyOptions
Assembly: RustyOptions.dll
Syntax
public static class ResultCollectionExtensions
Methods
| Edit this page View SourceErrors<T, TErr>(IEnumerable<Result<T, TErr>>)
Flattens a sequence of Result<T, TErr> into a sequence containing all error values. Ok results are discarded.
Declaration
public static IEnumerable<TErr> Errors<T, TErr>(this IEnumerable<Result<T, TErr>> self) where T : notnull
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<Result<T, TErr>> | self | The sequence of results. |
Returns
Type | Description |
---|---|
IEnumerable<TErr> | A flattened sequence of error values. |
Type Parameters
Name | Description |
---|---|
T | |
TErr |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when |
Values<T, TErr>(IEnumerable<Result<T, TErr>>)
Flattens a sequence of Result<T, TErr> into a sequence containing all inner values. Error results are discarded.
Declaration
public static IEnumerable<T> Values<T, TErr>(this IEnumerable<Result<T, TErr>> self) where T : notnull
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<Result<T, TErr>> | self | The sequence of results. |
Returns
Type | Description |
---|---|
IEnumerable<T> | A flattened sequence of values. |
Type Parameters
Name | Description |
---|---|
T | |
TErr |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when |