Struct LeaseIdentity
Represents a lease in the particular point in time.
Implements
Inherited Members
Namespace: DotNext.Threading.Leases
Assembly: DotNext.Threading.dll
Syntax
public readonly struct LeaseIdentity : IEquatable<LeaseIdentity>
Fields
| Edit this page View SourceInitialVersion
Represents initial version of a lease which cannot be renewed or released but can be acquired.
Declaration
[CLSCompliant(false)]
public const ulong InitialVersion = 0
Field Value
Type | Description |
---|---|
ulong |
Properties
| Edit this page View SourceId
Gets an ID of the lease.
Declaration
public Guid Id { get; init; }
Property Value
Type | Description |
---|---|
Guid |
Remarks
This property can be used only if the provider supports the deletion of leases. In that case, a newly created lease after its deletion must have unique random ID to prevent its renewal from the stale client.
Version
Gets a version of the lease.
Declaration
[CLSCompliant(false)]
public required ulong Version { get; init; }
Property Value
Type | Description |
---|---|
ulong |
Methods
| Edit this page View SourceEquals(LeaseIdentity)
Determines whether this identity is the same as the specified one.
Declaration
public bool Equals(LeaseIdentity other)
Parameters
Type | Name | Description |
---|---|---|
LeaseIdentity | other | The identity to be compared. |
Returns
Type | Description |
---|---|
bool | true if this identity is the same as |
Equals(object?)
Indicates whether this instance and a specified object are equal.
Declaration
public override bool Equals(object? other)
Parameters
Type | Name | Description |
---|---|---|
object | other |
Returns
Type | Description |
---|---|
bool | true if |
Overrides
| Edit this page View SourceGetHashCode()
Returns the hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | A 32-bit signed integer that is the hash code for this instance. |
Overrides
| Edit this page View SourcePrecedes(in LeaseIdentity)
Determines whether this identity immediately precedes the specified identity.
Declaration
public bool Precedes(in LeaseIdentity other)
Parameters
Type | Name | Description |
---|---|---|
LeaseIdentity | other | The identity to compare. |
Returns
Type | Description |
---|---|
bool | true if this identity immediately precedes |
Operators
| Edit this page View Sourceoperator ==(in LeaseIdentity, in LeaseIdentity)
Determines whether the two identities are equal.
Declaration
public static bool operator ==(in LeaseIdentity x, in LeaseIdentity y)
Parameters
Type | Name | Description |
---|---|---|
LeaseIdentity | x | The first identity to compare. |
LeaseIdentity | y | The second identity to compare. |
Returns
Type | Description |
---|---|
bool |
operator !=(in LeaseIdentity, in LeaseIdentity)
Determines whether the two identities are not equal.
Declaration
public static bool operator !=(in LeaseIdentity x, in LeaseIdentity y)
Parameters
Type | Name | Description |
---|---|---|
LeaseIdentity | x | The first identity to compare. |
LeaseIdentity | y | The second identity to compare. |
Returns
Type | Description |
---|---|
bool |
operator <<(in LeaseIdentity, in LeaseIdentity)
Determines whether identity x
immediately precedes identity y
.
Declaration
public static bool operator <<(in LeaseIdentity x, in LeaseIdentity y)
Parameters
Type | Name | Description |
---|---|---|
LeaseIdentity | x | The first identity to compare. |
LeaseIdentity | y | The second identity to compare. |
Returns
Type | Description |
---|---|
bool | true if identity |
operator >>(in LeaseIdentity, in LeaseIdentity)
Determines whether identity x
immediately supersedes identity y
.
Declaration
public static bool operator >>(in LeaseIdentity x, in LeaseIdentity y)
Parameters
Type | Name | Description |
---|---|---|
LeaseIdentity | x | The first identity to compare. |
LeaseIdentity | y | The second identity to compare. |
Returns
Type | Description |
---|---|
bool | true if identity |