Struct ProgressToken
- Namespace
- ModelContextProtocol.Protocol.Messages
- Assembly
- ModelContextProtocol.dll
Represents a progress token, which can be either a string or an integer.
[JsonConverter(typeof(ProgressToken.Converter))]
public readonly struct ProgressToken : IEquatable<ProgressToken>
- Implements
- Inherited Members
Constructors
ProgressToken(long)
Initializes a new instance of the ProgressToken with a specified value.
public ProgressToken(long value)
Parameters
value
longThe required ID value.
ProgressToken(string)
Initializes a new instance of the ProgressToken with a specified value.
public ProgressToken(string value)
Parameters
value
stringThe required ID value.
Properties
Token
Gets the underlying object for this token.
public object? Token { get; }
Property Value
Remarks
Methods
Equals(ProgressToken)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(ProgressToken other)
Parameters
other
ProgressTokenAn object to compare with this object.
Returns
Equals(object?)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object? obj)
Parameters
obj
objectThe object to compare with the current instance.
Returns
- bool
true if
obj
and this instance are the same type and represent the same value; otherwise, false.
GetHashCode()
Returns the hash code for this instance.
public override int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.
ToString()
Returns the fully qualified type name of this instance.
public override string? ToString()
Returns
- string
The fully qualified type name.
Operators
operator ==(ProgressToken, ProgressToken)
public static bool operator ==(ProgressToken left, ProgressToken right)
Parameters
left
ProgressTokenright
ProgressToken
Returns
operator !=(ProgressToken, ProgressToken)
public static bool operator !=(ProgressToken left, ProgressToken right)
Parameters
left
ProgressTokenright
ProgressToken