UniqueId Structure

A unique identifier.

Definition

Namespace: MailKit
Assembly: MailKit (in MailKit.dll) Version: 5.0.0
C#
public readonly struct UniqueId : IComparable<UniqueId>, 
	IEquatable<UniqueId>
Inheritance
Object    ValueType    UniqueId
Implements
IComparableUniqueId, IEquatableUniqueId

Remarks

Represents a unique identifier for messages in a IMailFolder.

A 32-bit value assigned to each message, which when used with the unique identifier validity value (see below) forms a 64-bit value that MUST NOT refer to any other message in the mailbox or any subsequent mailbox with the same name forever.Unique identifiers are assigned in a strictly ascending fashion in the mailbox; as each message is added to the mailbox it is assigned a higher UID than the message(s) which were added previously. Unlike message sequence numbers, unique identifiers are not necessarily contiguous.

The unique identifier of a message MUST NOT change during the session, and SHOULD NOT change between sessions. Any change of unique identifiers between sessions MUST be detectable using the UIDVALIDITY mechanism discussed below. Persistent unique identifiers are required for a client to resynchronize its state from a previous session with the server (e.g., disconnected or offline access clients); this is discussed further in [IMAP-DISC].

Constructors

UniqueId(UInt32) Initializes a new instance of the UniqueId struct.
UniqueId(UInt32, UInt32) Initializes a new instance of the UniqueId struct.

Properties

Id Gets the identifier.
IsValid Gets whether or not the unique identifier is valid.
Validity Gets the validity, if non-zero.

Methods

CompareTo Compares two UniqueId objects.
Equals(Object) Determines whether the specified Object is equal to the current UniqueId.
(Overrides ValueTypeEquals(Object))
Equals(UniqueId) Determines whether the specified UniqueId is equal to the current UniqueId.
GetHashCode Serves as a hash function for a UniqueId object.
(Overrides ValueTypeGetHashCode)
GetType Gets the Type of the current instance.
(Inherited from Object)
Parse(String) Parse a unique identifier.
Parse(String, UInt32) Parse a unique identifier.
ToString Returns a String that represents the current UniqueId.
(Overrides ValueTypeToString)
TryParse(String, UniqueId) Attempt to parse a unique identifier.
TryParse(String, UInt32, UniqueId) Attempt to parse a unique identifier.

Operators

Equality(UniqueId, UniqueId) Determines whether two unique identifiers are equal.
GreaterThan(UniqueId, UniqueId) Determines whether one unique identifier is greater than another unique identifier.
GreaterThanOrEqual(UniqueId, UniqueId) Determines whether one unique identifier is greater than or equal to another unique identifier.
Inequality(UniqueId, UniqueId) Determines whether two unique identifiers are not equal.
LessThan(UniqueId, UniqueId) Determines whether one unique identifier is less than another unique identifier.
LessThanOrEqual(UniqueId, UniqueId) Determines whether one unique identifier is less than or equal to another unique identifier.

Fields

Invalid The invalid UniqueId value.
MaxValue The maximum UniqueId value.
MinValue The minimum UniqueId value.

See Also

Reference