Struct RequestId
- Namespace
- StreamJsonRpc
- Assembly
- StreamJsonRpc.dll
Represents the ID of a request, whether it is a number or a string.
[JsonConverter(typeof(RequestIdJsonConverter))]
public struct RequestId : IEquatable<RequestId>
- Implements
- Inherited Members
Constructors
RequestId(long)
Initializes a new instance of the RequestId struct.
public RequestId(long id)
Parameters
id
longThe ID of the request.
RequestId(string?)
Initializes a new instance of the RequestId struct.
public RequestId(string? id)
Parameters
id
stringThe ID of the request.
Properties
IsEmpty
Gets a value indicating whether the request ID was not specified (i.e. no string, number or null was given).
public bool IsEmpty { get; }
Property Value
IsNull
Gets a value indicating whether this request ID is explicitly specified as the special "null" value.
public readonly bool IsNull { get; }
Property Value
NotSpecified
Gets an empty (absent) ID.
public static RequestId NotSpecified { get; }
Property Value
Null
Gets the special value for an explicitly specified null request ID.
public static RequestId Null { get; }
Property Value
Number
Gets the ID if it is a number.
public readonly long? Number { get; }
Property Value
- long?
String
Gets the ID if it is a string.
public readonly string? String { get; }
Property Value
Methods
Equals(RequestId)
public bool Equals(RequestId other)
Parameters
other
RequestId
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
obj
object
Returns
GetHashCode()
public override int GetHashCode()
Returns
ToString()
public override string ToString()
Returns
Operators
operator ==(RequestId, RequestId)
Tests equality between two RequestId values.
public static bool operator ==(RequestId first, RequestId second)
Parameters
Returns
operator !=(RequestId, RequestId)
Tests inequality between two RequestId values.
public static bool operator !=(RequestId first, RequestId second)