Show / Hide Table of Contents

Struct LeaseIdentity

Represents a lease in the particular point in time.

Implements
IEquatable<LeaseIdentity>
Inherited Members
ValueType.ToString()
object.Equals(object, object)
object.GetType()
object.ReferenceEquals(object, object)
Namespace: DotNext.Threading.Leases
Assembly: DotNext.Threading.dll
Syntax
public readonly struct LeaseIdentity : IEquatable<LeaseIdentity>

Fields

| Edit this page View Source

InitialVersion

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 Source

Id

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.

| Edit this page View Source

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 Source

Equals(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 other; otherwise, false.

| Edit this page View Source

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 obj and this instance are the same type and represent the same value; otherwise, false.

Overrides
ValueType.Equals(object)
| Edit this page View Source

GetHashCode()

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
ValueType.GetHashCode()
| Edit this page View Source

Precedes(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 other; otherwise, false.

Operators

| Edit this page View Source

operator ==(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

true if x is equal to y; otherwise, false.

| Edit this page View Source

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

true if x is not equal to y; otherwise, false.

| Edit this page View Source

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 x immediately precedes y; otherwise, false.

| Edit this page View Source

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 x immediately supersedes y; otherwise, false.

Implements

IEquatable<T>

Extension Methods

BasicExtensions.IsBetween<T, TLowerBound, TUpperBound>(T, TLowerBound, TUpperBound)
BasicExtensions.IsOneOf<T>(T, ReadOnlySpan<T>)
Collection.ToAsyncEnumerator<TEnumerator, T>(TEnumerator, CancellationToken)
Collection.ToClassicEnumerator<TEnumerator, T>(TEnumerator)
Enumerator.Skip<TEnumerator, T>(ref TEnumerator, int)
ExpressionBuilder.Const<T>(T)
  • Edit this page
  • View Source
☀
☾
In this article
Back to top
Supported by the .NET Foundation
☀
☾