Struct UserId
User ID of the form @localpart:server.
Implements
Inherited Members
Namespace: Uniform.Matrix.Protocol.Core
Assembly: Uniform.Matrix.Protocol.Core.dll
Syntax
public readonly record struct UserId : IEquatable<UserId>
Examples
UserId id = UserId.Parse("@alice:matrix.org");
Uri homeserver = await HomeserverDiscovery.DiscoverAsync(http, id.ServerName);
Constructors
| Edit this page View SourceUserId(string, string)
User ID of the form @localpart:server.
Declaration
public UserId(string Localpart, string ServerName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | Localpart | Part between |
| string | ServerName | Homeserver name, possibly with a port. |
Examples
UserId id = UserId.Parse("@alice:matrix.org");
Uri homeserver = await HomeserverDiscovery.DiscoverAsync(http, id.ServerName);
Properties
| Edit this page View SourceLocalpart
Part between @ and the first :.
Declaration
public string Localpart { get; init; }
Property Value
| Type | Description |
|---|---|
| string |
ServerName
Homeserver name, possibly with a port.
Declaration
public string ServerName { get; init; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
| Edit this page View SourceParse(string)
Parse value; throw FormatException when invalid.
Declaration
public static UserId Parse(string value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | value |
Returns
| Type | Description |
|---|---|
| UserId |
ToString()
Format as @localpart:server.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string |
Overrides
| Edit this page View SourceTryParse(string?, out UserId)
Parse value; false when it is not of the form @localpart:server.
Declaration
public static bool TryParse(string? value, out UserId userId)
Parameters
| Type | Name | Description |
|---|---|---|
| string | value | |
| UserId | userId |
Returns
| Type | Description |
|---|---|
| bool |