Struct Ipv4Port
Namespace: Tool.Sockets.Kernels
Assembly: Tool.Net.dll
用于IP:Port信息
public readonly struct Ipv4Port : IEquatable<Ipv4Port>Implements
Inherited Members
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()
Extension Methods
ObjectExtension.Add<T>(object, object, object), ObjectExtension.CopyEntity(object, object, params string[]), ObjectExtension.EntityToJson(object), ObjectExtension.EntityToJson(object, bool), ObjectExtension.EntityToJson(object, bool, string), DictionaryExtension.GetDictionary(object), TypeExtension.GetFieldKey(object, string, out bool), TypeExtension.GetFieldKey<T>(object, string, out bool), TypeExtension.GetFieldKey(object, Type, string, out bool), ObjectExtension.GetIntPtr(object), ObjectExtension.GetIntPtrInt(object), TypeExtension.GetPropertieFind(object, string, bool), TypeExtension.GetProperties(object), TypeExtension.GetPropertyKey(object, string, out bool), TypeExtension.GetPropertyKey<T>(object, string, out bool), TypeExtension.GetPropertyKey(object, Type, string, out bool), TypeExtension.GetValue(object, PropertyDescriptor), TypeExtension.GetValue(object, string, bool), TypeExtension.GetValue(object, string), ObjectExtension.Read<T>(object, object, int, int), ObjectExtension.Read<T>(object, int, object, int, int), DictionaryExtension.SetDictionary(object, IDictionary<string, object>), TypeExtension.SetFieldKey(object, string, object), TypeExtension.SetFieldKey<T>(object, string, object), TypeExtension.SetFieldKey(object, Type, string, object), TypeExtension.SetPropertyKey(object, string, object), TypeExtension.SetPropertyKey<T>(object, string, object), TypeExtension.SetPropertyKey(object, Type, string, object), TypeExtension.SetValue(object, PropertyDescriptor, object), TypeExtension.SetValue(object, string, object, bool), TypeExtension.SetValue(object, string, object), ObjectExtension.ToBase64String(object), ObjectExtension.ToBytes(object), ObjectExtension.ToBytes(object, out Type), DictionaryExtension.ToDictionary(object), DictionaryExtension.ToDictionary<T>(object), DictionaryExtension.ToIDictionary(object), DictionaryExtension.ToIDictionary<T>(object), ObjectExtension.ToJson(object), ObjectExtension.ToJson(object, JsonSerializerOptions), ObjectExtension.ToJsonWeb(object), ObjectExtension.ToJsonWeb(object, Action<JsonSerializerOptions>), ObjectExtension.ToTryVar<T>(object, T), ObjectExtension.ToVar<T>(object), ObjectExtension.ToVar(object, Type, bool), ObjectExtension.ToVar(object, string), ObjectExtension.ToXml(object)
Properties
Empty
获取一个空类型
public static Ipv4Port Empty { get; }Property Value
Ip
获取 对象
public IPAddress Ip { get; }Property Value
IsEmpty
判断当前值是否为空
public bool IsEmpty { get; }Property Value
Port
获取端口号
public ushort Port { get; }Property Value
Span
当前IP:Port信息内存数据
public Span<byte> Span { get; }Property Value
Methods
CopyTo(Span<byte>)
将IP:Port信息拷贝到内存
public void CopyTo(Span<byte> destination)Parameters
内存数据
Equals(Ipv4Port)
判断是否一致
public bool Equals(Ipv4Port other)Parameters
other Ipv4Port
比较值
Returns
是或否
Equals(object)
比较两个值是否一致
public override bool Equals(object obj)Parameters
obj object
比较值
Returns
是或否
GetHashCode()
获取哈希值
public override int GetHashCode()Returns
哈希值
ToString()
获取IP:Port信息
public override string ToString()Returns
结果
Operators
operator ==(Ipv4Port, Ipv4Port)
指示两个 结构是否相等。
public static bool operator ==(Ipv4Port a, Ipv4Port b)Parameters
a Ipv4Port
相等运算符左侧的结构
b Ipv4Port
相等运算符右侧的结构
Returns
如果 true 等于 a,则为 b;否则为 false。
implicit operator Ipv4Port(string)
定义从 对象到 对象的隐式转换。
public static implicit operator Ipv4Port(string ipport)Parameters
ipport string
要转换的对象。
Returns
转换的 对象。
implicit operator Ipv4Port(UserKey)
定义从 对象到 对象的隐式转换。
public static implicit operator Ipv4Port(UserKey ipport)Parameters
ipport UserKey
要转换的对象。
Returns
转换的 对象。
implicit operator string(Ipv4Port)
定义从 对象到 对象的隐式转换。
public static implicit operator string(Ipv4Port ipport)Parameters
ipport Ipv4Port
要转换的对象。
Returns
转换的 对象。
operator !=(Ipv4Port, Ipv4Port)
指示两个 结构是否不相等。
public static bool operator !=(Ipv4Port a, Ipv4Port b)Parameters
a Ipv4Port
不等运算符左侧的结构
b Ipv4Port
不等运算符右侧的结构
Returns
如果 true 不等于 a,则为 b;否则为 false。