Show / Hide Table of Contents

Struct ClusterMemberId

Represents unique identifier of cluster member.

Implements
IEquatable<ClusterMemberId>
IBinaryFormattable<ClusterMemberId>
Inherited Members
object.GetType()
object.Equals(object, object)
object.ReferenceEquals(object, object)
Namespace: DotNext.Net.Cluster
Assembly: DotNext.Net.Cluster.dll
Syntax
public readonly struct ClusterMemberId : IEquatable<ClusterMemberId>, IBinaryFormattable<ClusterMemberId>

Constructors

View Source

ClusterMemberId(Random)

Initializes a new random unique identifier.

Declaration
public ClusterMemberId(Random random)
Parameters
Type Name Description
Random random

The source of random values.

Exceptions
Type Condition
ArgumentNullException

random is null.

View Source

ClusterMemberId(ReadOnlySpan<byte>)

Initializes a new unique identifier from set of bytes.

Declaration
public ClusterMemberId(ReadOnlySpan<byte> bytes)
Parameters
Type Name Description
ReadOnlySpan<byte> bytes

The memory block of bytes.

Exceptions
Type Condition
ArgumentOutOfRangeException

bytes is too small.

Methods

View Source

Equals(ClusterMemberId)

Determines whether the current identifier is equal to another identifier.

Declaration
public bool Equals(ClusterMemberId other)
Parameters
Type Name Description
ClusterMemberId other

The identifier to compare.

Returns
Type Description
bool

true if this identifier is equal to other; otherwise, false.

View Source

Equals(object?)

Determines whether the current identifier is equal to another identifier.

Declaration
public override bool Equals(object? other)
Parameters
Type Name Description
object other

The identifier to compare.

Returns
Type Description
bool

true if this identifier is equal to other; otherwise, false.

Overrides
ValueType.Equals(object)
View Source

Format(Span<byte>)

Serializes the value as a sequence of bytes.

Declaration
public void Format(Span<byte> output)
Parameters
Type Name Description
Span<byte> output

The output buffer.

View Source

FromEndPoint(EndPoint?)

Constructs cluster member id from its endpoint address.

Declaration
public static ClusterMemberId FromEndPoint(EndPoint? ep)
Parameters
Type Name Description
EndPoint ep

The address of the cluster member.

Returns
Type Description
ClusterMemberId

The identifier of the cluster member.

View Source

GetHashCode()

Gets the hash code of this identifier.

Declaration
public override int GetHashCode()
Returns
Type Description
int

The hash code of this identifier.

Overrides
ValueType.GetHashCode()
View Source

ToString()

Returns hexadecimal representation of this identifier.

Declaration
public override string ToString()
Returns
Type Description
string

The hexadecimal representation of this identifier.

Overrides
ValueType.ToString()
View Source

TryParse(ReadOnlySpan<char>, out ClusterMemberId)

Attempts to parse cluster member identifier.

Declaration
public static bool TryParse(ReadOnlySpan<char> identifier, out ClusterMemberId value)
Parameters
Type Name Description
ReadOnlySpan<char> identifier

The hexadecimal representation of identifier.

ClusterMemberId value

The parsed identifier.

Returns
Type Description
bool

true if identifier parsed successfully; otherwise, false.

View Source

TryParse(string?, out ClusterMemberId)

Attempts to parse cluster member identifier.

Declaration
public static bool TryParse(string? identifier, out ClusterMemberId value)
Parameters
Type Name Description
string identifier

The hexadecimal representation of identifier.

ClusterMemberId value

The parsed identifier.

Returns
Type Description
bool

true if identifier parsed successfully; otherwise, false.

Operators

View Source

operator ==(in ClusterMemberId, in ClusterMemberId)

Determines whether the two identifiers are equal.

Declaration
public static bool operator ==(in ClusterMemberId x, in ClusterMemberId y)
Parameters
Type Name Description
ClusterMemberId x

The first identifier to compare.

ClusterMemberId y

The second identifier to compare.

Returns
Type Description
bool

true if both identifiers are equal; otherwise, false.

View Source

operator !=(in ClusterMemberId, in ClusterMemberId)

Determines whether the two identifiers are not equal.

Declaration
public static bool operator !=(in ClusterMemberId x, in ClusterMemberId y)
Parameters
Type Name Description
ClusterMemberId x

The first identifier to compare.

ClusterMemberId y

The second identifier to compare.

Returns
Type Description
bool

true if both identifiers are not equal; otherwise, false.

Explicit Interface Implementations

View Source

Size

Gets size of this type, in bytes.

Declaration
static int Size { get; }
Returns
Type Description
int

Implements

IEquatable<T>
IBinaryFormattable<TSelf>

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
☀
☾