Show / Hide Table of Contents

Struct DelegatingConsumer<T>

Represents implementation of IConsumer<T> that delegates invocation to the delegate of type Action<T>.

Implements
IConsumer<T>
IFunctional
IEquatable<DelegatingConsumer<T>>
Inherited Members
object.GetType()
object.Equals(object, object)
object.ReferenceEquals(object, object)
Namespace: DotNext
Assembly: DotNext.dll
Syntax
public readonly struct DelegatingConsumer<T> : IConsumer<T>, IFunctional, IEquatable<DelegatingConsumer<T>> where T : allows ref struct
Type Parameters
Name Description
T

The type of the consumer argument.

Constructors

View Source

DelegatingConsumer(Action<T>)

Wraps the delegate instance.

Declaration
public DelegatingConsumer(Action<T> action)
Parameters
Type Name Description
Action<T> action

The delegate instance.

Exceptions
Type Condition
ArgumentNullException

action is null.

Properties

View Source

IsEmpty

Gets a value indicating that the underlying delegate is null.

Declaration
public bool IsEmpty { get; }
Property Value
Type Description
bool

Methods

View Source

Equals(DelegatingConsumer<T>)

Declaration
public bool Equals(DelegatingConsumer<T> other)
Parameters
Type Name Description
DelegatingConsumer<T> other
Returns
Type Description
bool
View Source

Equals(object)

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
object obj
Returns
Type Description
bool
Overrides
ValueType.Equals(object)
View Source

GetHashCode()

Declaration
public override int GetHashCode()
Returns
Type Description
int
Overrides
ValueType.GetHashCode()
View Source

ToString()

Declaration
public override string? ToString()
Returns
Type Description
string
Overrides
ValueType.ToString()

Operators

View Source

operator ==(DelegatingConsumer<T>, DelegatingConsumer<T>)

Declaration
public static bool operator ==(DelegatingConsumer<T> left, DelegatingConsumer<T> right)
Parameters
Type Name Description
DelegatingConsumer<T> left
DelegatingConsumer<T> right
Returns
Type Description
bool
View Source

implicit operator DelegatingConsumer<T>(Action<T>)

Wraps the delegate.

Declaration
public static implicit operator DelegatingConsumer<T>(Action<T> action)
Parameters
Type Name Description
Action<T> action

The delegate to be wrapped.

Returns
Type Description
DelegatingConsumer<T>

The consumer representing the delegate.

View Source

operator !=(DelegatingConsumer<T>, DelegatingConsumer<T>)

Declaration
public static bool operator !=(DelegatingConsumer<T> left, DelegatingConsumer<T> right)
Parameters
Type Name Description
DelegatingConsumer<T> left
DelegatingConsumer<T> right
Returns
Type Description
bool

Implements

IConsumer<T>
IFunctional
IEquatable<T>

Extension Methods

BasicExtensions.IsBetween<T, TLowerBound, TUpperBound>(T, TLowerBound, TUpperBound)
BasicExtensions.IsOneOf<T>(T, params ReadOnlySpan<T>)
Enumerator.Skip<TEnumerator, T>(ref TEnumerator, int)
  • View Source
☀
☾
In this article
Back to top
Supported by the .NET Foundation
☀
☾