Show / Hide Table of Contents

Struct LeaseIdentity

Represents a lease in the particular point in time.

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

Fields

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

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.

View Source

Version

Gets a version of the lease.

Declaration
[CLSCompliant(false)]
public required ulong Version { get; init; }
Property Value
Type Description
ulong

Methods

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.

View Source

Equals(object?)

Declaration
public override bool Equals(object? other)
Parameters
Type Name Description
object other
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

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

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.

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.

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.

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, params ReadOnlySpan<T>)
Enumerator.Skip<TEnumerator, T>(ref TEnumerator, int)
  • View Source
☀
☾
In this article
Back to top
Supported by the .NET Foundation
☀
☾