Struct RequestId
- Namespace
- ModelContextProtocol.Protocol
- Assembly
- ModelContextProtocol.Core.dll
Represents a JSON-RPC request identifier, which can be either a string or an integer.
[JsonConverter(typeof(RequestId.Converter))]
public readonly struct RequestId : IEquatable<RequestId>
- Implements
- Inherited Members
Constructors
RequestId(long)
Initializes a new instance of the RequestId with a specified value.
public RequestId(long value)
Parameters
valuelongThe required ID value.
RequestId(string)
Initializes a new instance of the RequestId with a specified value.
public RequestId(string value)
Parameters
valuestringThe required ID value.
Properties
Id
Gets the underlying object for this id.
public object? Id { get; }
Property Value
Remarks
Methods
Equals(RequestId)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(RequestId other)
Parameters
otherRequestIdAn 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
objobjectThe object to compare with the current instance.
Returns
- bool
true if
objand 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 ==(RequestId, RequestId)
public static bool operator ==(RequestId left, RequestId right)
Parameters
Returns
operator !=(RequestId, RequestId)
public static bool operator !=(RequestId left, RequestId right)