NativeHashSet<T> 结构
Native hashSet
命名空间: NativeCollections
程序集: Fantasy.Net.dll
语法
[StructLayout(LayoutKind.Sequential)]
public readonly struct NativeHashSet<T> : IDisposable, IEquatable<NativeHashSet<T>> where T : unmanaged, IEquatable<T>
类型参数
名称 | 描述 |
---|---|
T | Type |
构造函数
| 编辑本文 查看源代码NativeHashSet(int)
Structure
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public NativeHashSet(int capacity)
参数
类型 | 名称 | 描述 |
---|---|---|
int | capacity | Capacity |
属性
| 编辑本文 查看源代码Count
Count
声明
public int Count { get; }
属性值
类型 | 描述 |
---|---|
int |
Empty
Empty
声明
public static NativeHashSet<T> Empty { get; }
属性值
类型 | 描述 |
---|---|
NativeHashSet<T> |
IsCreated
Is created
声明
public bool IsCreated { get; }
属性值
类型 | 描述 |
---|---|
bool |
IsEmpty
Is empty
声明
public bool IsEmpty { get; }
属性值
类型 | 描述 |
---|---|
bool |
方法
| 编辑本文 查看源代码Add(in T)
Add
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Add(in T item)
参数
类型 | 名称 | 描述 |
---|---|---|
T | item | Item |
返回
类型 | 描述 |
---|---|
bool | Added |
Clear()
Clear
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Clear()
Contains(in T)
Contains
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Contains(in T item)
参数
类型 | 名称 | 描述 |
---|---|---|
T | item | Item |
返回
类型 | 描述 |
---|---|
bool | Contains |
Dispose()
Dispose
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Dispose()
EnsureCapacity(int)
Ensure capacity
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int EnsureCapacity(int capacity)
参数
类型 | 名称 | 描述 |
---|---|---|
int | capacity | Capacity |
返回
类型 | 描述 |
---|---|
int | New capacity |
Equals(NativeHashSet<T>)
Equals
声明
public bool Equals(NativeHashSet<T> other)
参数
类型 | 名称 | 描述 |
---|---|---|
NativeHashSet<T> | other | Other |
返回
类型 | 描述 |
---|---|
bool | Equals |
Equals(object?)
Equals
声明
public override bool Equals(object? obj)
参数
类型 | 名称 | 描述 |
---|---|---|
object | obj | object |
返回
类型 | 描述 |
---|---|
bool | Equals |
重写
| 编辑本文 查看源代码GetEnumerator()
Get enumerator
声明
public NativeHashSet<T>.Enumerator GetEnumerator()
返回
类型 | 描述 |
---|---|
NativeHashSet<T>.Enumerator | Enumerator |
GetHashCode()
Get hashCode
声明
public override int GetHashCode()
返回
类型 | 描述 |
---|---|
int | HashCode |
重写
| 编辑本文 查看源代码Remove(in T)
Remove
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Remove(in T item)
参数
类型 | 名称 | 描述 |
---|---|---|
T | item | Item |
返回
类型 | 描述 |
---|---|
bool | Removed |
ToString()
To string
声明
public override string ToString()
返回
类型 | 描述 |
---|---|
string | String |
重写
| 编辑本文 查看源代码TrimExcess()
Trim excess
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int TrimExcess()
返回
类型 | 描述 |
---|---|
int | New capacity |
TryGetValue(in T, out T)
Try to get the actual value
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool TryGetValue(in T equalValue, out T actualValue)
参数
类型 | 名称 | 描述 |
---|---|---|
T | equalValue | Equal value |
T | actualValue | Actual value |
返回
类型 | 描述 |
---|---|
bool | Got |
运算符
| 编辑本文 查看源代码operator ==(NativeHashSet<T>, NativeHashSet<T>)
Equals
声明
public static bool operator ==(NativeHashSet<T> left, NativeHashSet<T> right)
参数
类型 | 名称 | 描述 |
---|---|---|
NativeHashSet<T> | left | Left |
NativeHashSet<T> | right | Right |
返回
类型 | 描述 |
---|---|
bool | Equals |
operator !=(NativeHashSet<T>, NativeHashSet<T>)
Not equals
声明
public static bool operator !=(NativeHashSet<T> left, NativeHashSet<T> right)
参数
类型 | 名称 | 描述 |
---|---|---|
NativeHashSet<T> | left | Left |
NativeHashSet<T> | right | Right |
返回
类型 | 描述 |
---|---|
bool | Not equals |