Struct BencodeSpanDictionary
A collection of keys and positions for a BencodeSpanReader.
Inherited Members
System.ValueType.Equals(System.Object)
System.ValueType.GetHashCode()
System.ValueType.ToString()
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: ItsyBitsy.Bencoding
Assembly: ItsyBitsy.Bencoding.dll
Syntax
public struct BencodeSpanDictionary
Remarks
BencodeSpanDictionary does not copy the keys from the
BencodeSpanReader, so it may have unexpected behavior if the underlying memory
is modified.
Properties
| Improve this Doc View SourceCount
Gets the number of elements in the dictionary.
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
| Improve this Doc View SourceGetEnumerator()
Gets an enumerator for the elements of the dictionary.
Declaration
public BencodeSpanDictionary.Enumerator GetEnumerator()
Returns
Type | Description |
---|---|
BencodeSpanDictionary.Enumerator | The enumerator. |
TryGetPosition(ReadOnlySpan<Byte>, out Int32)
Attempts to get the position of the value associated with the specified key.
Declaration
public bool TryGetPosition(ReadOnlySpan<byte> key, out int position)
Parameters
Type | Name | Description |
---|---|---|
System.ReadOnlySpan<System.Byte> | key | The key to look up. |
System.Int32 | position | Returns the position if the key exists in the dictionary; otherwise, the default value. |
Returns
Type | Description |
---|---|
System.Boolean | true if the key exists in the dictionary; otherwise, false. |