Method FillBackward
View SourceFillBackward<T>(IAsyncEnumerable<T>)
Returns a sequence with each null reference or value in the source replaced with the following non-null reference or value in that sequence.
Declaration
public static IAsyncEnumerable<T> FillBackward<T>(this IAsyncEnumerable<T> source)
Parameters
Type | Name | Description |
---|---|---|
IAsyncEnumerable<T> | source | The source sequence. |
Returns
Type | Description |
---|---|
IAsyncEnumerable<T> | An IAsyncEnumerable<T> with null references or values replaced. |
Type Parameters
Name | Description |
---|---|
T | Type of the elements in the source sequence. |
Remarks
This method uses deferred execution semantics and streams its results. If references or values are null at the end of the sequence then they remain null.
FillBackward<T>(IAsyncEnumerable<T>, Func<T, bool>)
Returns a sequence with each missing element in the source replaced with the following non-missing element in that sequence. An additional parameter specifies a function used to determine if an element is considered missing or not.
Declaration
public static IAsyncEnumerable<T> FillBackward<T>(this IAsyncEnumerable<T> source, Func<T, bool> predicate)
Parameters
Type | Name | Description |
---|---|---|
IAsyncEnumerable<T> | source | The source sequence. |
Func<T, bool> | predicate | The function used to determine if an element in the sequence is considered missing. |
Returns
Type | Description |
---|---|
IAsyncEnumerable<T> | An IAsyncEnumerable<T> with missing values replaced. |
Type Parameters
Name | Description |
---|---|
T | Type of the elements in the source sequence. |
Remarks
This method uses deferred execution semantics and streams its results. If elements are missing at the end of the sequence then they remain missing.
FillBackward<T>(IAsyncEnumerable<T>, Func<T, ValueTask<bool>>)
Returns a sequence with each missing element in the source replaced with the following non-missing element in that sequence. An additional parameter specifies a function used to determine if an element is considered missing or not.
Declaration
public static IAsyncEnumerable<T> FillBackward<T>(this IAsyncEnumerable<T> source, Func<T, ValueTask<bool>> predicate)
Parameters
Type | Name | Description |
---|---|---|
IAsyncEnumerable<T> | source | The source sequence. |
Func<T, ValueTask<bool>> | predicate | The function used to determine if an element in the sequence is considered missing. |
Returns
Type | Description |
---|---|
IAsyncEnumerable<T> | An IAsyncEnumerable<T> with missing values replaced. |
Type Parameters
Name | Description |
---|---|
T | Type of the elements in the source sequence. |
Remarks
This method uses deferred execution semantics and streams its results. If elements are missing at the end of the sequence then they remain missing.
FillBackward<T>(IAsyncEnumerable<T>, Func<T, bool>, Func<T, T, T>)
Returns a sequence with each missing element in the source replaced with the following non-missing element in that sequence. Additional parameters specify two functions, one used to determine if an element is considered missing or not and another to provide the replacement for the missing element.
Declaration
public static IAsyncEnumerable<T> FillBackward<T>(this IAsyncEnumerable<T> source, Func<T, bool> predicate, Func<T, T, T> fillSelector)
Parameters
Type | Name | Description |
---|---|---|
IAsyncEnumerable<T> | source | The source sequence. |
Func<T, bool> | predicate | The function used to determine if an element in the sequence is considered missing. |
Func<T, T, T> | fillSelector | The function used to produce the element that will replace the missing one. Its first argument receives the current element considered missing while the second argument receives the next non-missing element. |
Returns
Type | Description |
---|---|
IAsyncEnumerable<T> | An IAsyncEnumerable<T> with missing elements filled. |
Type Parameters
Name | Description |
---|---|
T | Type of the elements in the source sequence. |
Remarks
This method uses deferred execution semantics and streams its results. If elements are missing at the end of the sequence then they remain missing.
FillBackward<T>(IAsyncEnumerable<T>, Func<T, ValueTask<bool>>, Func<T, T, T>)
Returns a sequence with each missing element in the source replaced with the following non-missing element in that sequence. Additional parameters specify two functions, one used to determine if an element is considered missing or not and another to provide the replacement for the missing element.
Declaration
public static IAsyncEnumerable<T> FillBackward<T>(this IAsyncEnumerable<T> source, Func<T, ValueTask<bool>> predicate, Func<T, T, T> fillSelector)
Parameters
Type | Name | Description |
---|---|---|
IAsyncEnumerable<T> | source | The source sequence. |
Func<T, ValueTask<bool>> | predicate | The function used to determine if an element in the sequence is considered missing. |
Func<T, T, T> | fillSelector | The function used to produce the element that will replace the missing one. Its first argument receives the current element considered missing while the second argument receives the next non-missing element. |
Returns
Type | Description |
---|---|
IAsyncEnumerable<T> | An IAsyncEnumerable<T> with missing elements filled. |
Type Parameters
Name | Description |
---|---|
T | Type of the elements in the source sequence. |
Remarks
This method uses deferred execution semantics and streams its results. If elements are missing at the end of the sequence then they remain missing.
FillBackward<T>(IAsyncEnumerable<T>, Func<T, bool>, Func<T, T, ValueTask<T>>)
Returns a sequence with each missing element in the source replaced with the following non-missing element in that sequence. Additional parameters specify two functions, one used to determine if an element is considered missing or not and another to provide the replacement for the missing element.
Declaration
public static IAsyncEnumerable<T> FillBackward<T>(this IAsyncEnumerable<T> source, Func<T, bool> predicate, Func<T, T, ValueTask<T>> fillSelector)
Parameters
Type | Name | Description |
---|---|---|
IAsyncEnumerable<T> | source | The source sequence. |
Func<T, bool> | predicate | The function used to determine if an element in the sequence is considered missing. |
Func<T, T, ValueTask<T>> | fillSelector | The function used to produce the element that will replace the missing one. Its first argument receives the current element considered missing while the second argument receives the next non-missing element. |
Returns
Type | Description |
---|---|
IAsyncEnumerable<T> | An IAsyncEnumerable<T> with missing elements filled. |
Type Parameters
Name | Description |
---|---|
T | Type of the elements in the source sequence. |
Remarks
This method uses deferred execution semantics and streams its results. If elements are missing at the end of the sequence then they remain missing.
FillBackward<T>(IAsyncEnumerable<T>, Func<T, ValueTask<bool>>, Func<T, T, ValueTask<T>>)
Returns a sequence with each missing element in the source replaced with the following non-missing element in that sequence. Additional parameters specify two functions, one used to determine if an element is considered missing or not and another to provide the replacement for the missing element.
Declaration
public static IAsyncEnumerable<T> FillBackward<T>(this IAsyncEnumerable<T> source, Func<T, ValueTask<bool>> predicate, Func<T, T, ValueTask<T>> fillSelector)
Parameters
Type | Name | Description |
---|---|---|
IAsyncEnumerable<T> | source | The source sequence. |
Func<T, ValueTask<bool>> | predicate | The function used to determine if an element in the sequence is considered missing. |
Func<T, T, ValueTask<T>> | fillSelector | The function used to produce the element that will replace the missing one. Its first argument receives the current element considered missing while the second argument receives the next non-missing element. |
Returns
Type | Description |
---|---|
IAsyncEnumerable<T> | An IAsyncEnumerable<T> with missing elements filled. |
Type Parameters
Name | Description |
---|---|
T | Type of the elements in the source sequence. |
Remarks
This method uses deferred execution semantics and streams its results. If elements are missing at the end of the sequence then they remain missing.