Show / Hide Table of Contents

Struct DelegatingSupplier<T, TResult>

Represents implementation of ISupplier<T, TResult> that delegates invocation to the delegate of type Func<T, TResult>.

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

The type of the argument.

TResult

The type of the result.

Constructors

View Source

DelegatingSupplier(Func<T, TResult>)

Wraps the delegate instance.

Declaration
public DelegatingSupplier(Func<T, TResult> func)
Parameters
Type Name Description
Func<T, TResult> func

The delegate instance.

Exceptions
Type Condition
ArgumentNullException

func 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(DelegatingSupplier<T, TResult>)

Declaration
public bool Equals(DelegatingSupplier<T, TResult> other)
Parameters
Type Name Description
DelegatingSupplier<T, TResult> 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 ==(DelegatingSupplier<T, TResult>, DelegatingSupplier<T, TResult>)

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

implicit operator DelegatingSupplier<T, TResult>(Func<T, TResult>)

Wraps the delegate instance.

Declaration
public static implicit operator DelegatingSupplier<T, TResult>(Func<T, TResult> func)
Parameters
Type Name Description
Func<T, TResult> func

The delegate instance.

Returns
Type Description
DelegatingSupplier<T, TResult>

The supplier represented by the delegate.

Exceptions
Type Condition
ArgumentNullException

func is null.

View Source

operator !=(DelegatingSupplier<T, TResult>, DelegatingSupplier<T, TResult>)

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

Implements

ISupplier<T, TResult>
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
☀
☾