结构 AgentId
public struct AgentId
- 继承成员
构造函数
AgentId(AgentType, string)
public AgentId(AgentType type, string key)
参数
AgentId(string, string)
初始化 AgentId 结构的新实例。
public AgentId(string type, string key)
参数
AgentId((string Type, string Key))
从元组初始化 AgentId 结构的新实例。
public AgentId((string Type, string Key) kvPair)
参数
字段
Key
代理实例标识符。字符串只能由字母数字字符 (a-z) 和 (0-9) 或下划线 (_) 组成。
public string Key
字段值
Type
将代理与特定工厂函数关联的标识符。字符串只能由字母数字字符 (a-z) 和 (0-9) 或下划线 (_) 组成。
public string Type
字段值
方法
Equals(object?)
确定指定的对象是否等于当前的 AgentId。
public override bool Equals(object? obj)
参数
objobject与当前实例进行比较的对象。
返回
FromStr(string)
将格式为 "type/key" 的字符串转换为 AgentId。
public static AgentId FromStr(string maybeAgentId)
参数
maybeAgentIdstring代理 ID 字符串。
返回
GetHashCode()
返回此 AgentId 的哈希代码。
public override int GetHashCode()
返回
- int
当前实例的哈希代码。
ToString()
返回 AgentId 的字符串表示形式。
public override string ToString()
返回
- 字符串
格式为 "type/key" 的字符串。
运算符
operator ==(AgentId, AgentId)
public static bool operator ==(AgentId left, AgentId right)
参数
返回
explicit operator AgentId(string)
将字符串显式转换为 AgentId。
public static explicit operator AgentId(string id)
参数
idstring代理 ID 的字符串表示形式。
返回
operator !=(AgentId, AgentId)
public static bool operator !=(AgentId left, AgentId right)