Struct ClusterMemberId
Represents unique identifier of cluster member.
Inherited Members
Namespace: DotNext.Net.Cluster
Assembly: DotNext.Net.Cluster.dll
Syntax
public readonly struct ClusterMemberId : IEquatable<ClusterMemberId>, IBinaryFormattable<ClusterMemberId>
Constructors
| Edit this page View SourceClusterMemberId(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 |
|
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 |
|
Properties
| Edit this page View SourceSize
Gets size of this type, in bytes.
Declaration
public static int Size { get; }
Property Value
Type | Description |
---|---|
int |
Methods
| Edit this page View SourceEquals(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 |
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 |
Overrides
| Edit this page View SourceFormat(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. |
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. |
GetHashCode()
Gets the hash code of this identifier.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | The hash code of this identifier. |
Overrides
| Edit this page View SourceToString()
Returns hexadecimal representation of this identifier.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | The hexadecimal representation of this identifier. |
Overrides
| Edit this page View SourceTryParse(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 |
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 |
Operators
| Edit this page View Sourceoperator ==(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 |
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 |