Show / Hide Table of Contents

Class ResultCollectionExtensions

Extension methods for working with collections involving Result<T, TErr>.

Inheritance
object
ResultCollectionExtensions
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: RustyOptions
Assembly: RustyOptions.dll
Syntax
public static class ResultCollectionExtensions

Methods

| Edit this page View Source

Errors<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 self is null.

| Edit this page View Source

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 self is null.

  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX