结构体 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)
参数
obj
object要与当前实例进行比较的对象。
返回值
FromStr(string)
将 "type/key" 格式的字符串转换为 AgentId。
public static AgentId FromStr(string maybeAgentId)
参数
maybeAgentId
string代理 ID 字符串。
返回值
GetHashCode()
返回此 AgentId 的哈希代码。
public override int GetHashCode()
返回值
- int
当前实例的哈希代码。
ToString()
返回 AgentId 的字符串表示形式。
public override string ToString()
返回值
- string
“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)
参数
id
string代理 ID 的字符串表示形式。
返回值
operator !=(AgentId, AgentId)
public static bool operator !=(AgentId left, AgentId right)