Class ServiceAddress
- Namespace
- IceRpc
- Assembly
- IceRpc.dll
Represents the URI of a service, parsed and processed for easier consumption by invokers. It's used to construct an OutgoingRequest.
[TypeConverter(typeof(ServiceAddressTypeConverter))]
public sealed record ServiceAddress : IEquatable<ServiceAddress>
- Inheritance
-
ServiceAddress
- Implements
- Inherited Members
Constructors
ServiceAddress(Protocol?)
Constructs a service address from a protocol.
public ServiceAddress(Protocol? protocol = null)
Parameters
ServiceAddress(Uri)
Constructs a service address from a URI.
public ServiceAddress(Uri uri)
Parameters
uri
UriThe Uri.
Properties
AltServerAddresses
Gets or initializes the secondary server addresses of this service address.
public ImmutableList<ServerAddress> AltServerAddresses { get; init; }
Property Value
- ImmutableList<ServerAddress>
The secondary server addresses of this service address. Defaults to Empty.
Fragment
Gets or initializes the fragment.
public string Fragment { get; init; }
Property Value
- string
The fragment of this service address. Defaults to an empty string.
OriginalUri
Gets the URI used to create this service address.
public Uri? OriginalUri { get; }
Property Value
- Uri
The Uri of this service address if it was constructed from a URI and if URI-derived properties have not been updated. The setting of a URI-derived property such as ServerAddress sets OriginalUri to null.
Params
Gets or initializes the parameters of this service address.
public ImmutableDictionary<string, string> Params { get; init; }
Property Value
- ImmutableDictionary<string, string>
The params dictionary. Always empty if ServerAddress is not null. Defaults to Empty.
Path
Gets or initializes the path of this service address.
public string Path { get; init; }
Property Value
- string
The path of this service address. Defaults to
/
.
Protocol
Gets the protocol of this service address.
public Protocol? Protocol { get; }
Property Value
- Protocol
The protocol of the service address. It corresponds to the URI scheme and is null for a relative service address.
ServerAddress
Gets or initializes the main server address of this service address.
public ServerAddress? ServerAddress { get; init; }
Property Value
- ServerAddress?
The main server address of this service address, or null if this service address has no server address.
Methods
Equals(ServiceAddress?)
Determines whether the specified ServiceAddress is equal to the current ServiceAddress.
public bool Equals(ServiceAddress? other)
Parameters
other
ServiceAddressThe ServiceAddress to compare with the current ServiceAddress.
Returns
- bool
true if the specified ServiceAddress is equal to the current ServiceAddress; otherwise, false.
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current ServiceAddress.
ToString()
Converts this service address into a string.
public override string ToString()
Returns
- string
The string representation of this service address.
ToUri()
Converts this service address into a Uri.
public Uri ToUri()
Returns
- Uri
An Uri representing this service address.