Class CharSpanLookupReadOnlyDictionary<TValue>
- Namespace
- DisCatSharp.Common
- Assembly
- DisCatSharp.Common.dll
Represents collection of string keys and TValue
values, allowing the use of ReadOnlySpan<T> for dictionary operations.
public sealed class CharSpanLookupReadOnlyDictionary<TValue> : IReadOnlyDictionary<string, TValue?>, IReadOnlyCollection<KeyValuePair<string, TValue?>>, IEnumerable<KeyValuePair<string, TValue?>>, IEnumerable
Type Parameters
TValue
Type of items in this dictionary.
- Inheritance
-
CharSpanLookupReadOnlyDictionary<TValue>
- Implements
-
IReadOnlyDictionary<string, TValue>
- Inherited Members
- Extension Methods
Constructors
- CharSpanLookupReadOnlyDictionary(IDictionary<string, TValue?>)
Creates a new CharSpanLookupReadOnlyDictionary<TValue> with string keys and items of type
TValue
and populates it with key-value pairs from supplied dictionary.
- CharSpanLookupReadOnlyDictionary(IEnumerable<KeyValuePair<string, TValue?>>)
Creates a new CharSpanLookupReadOnlyDictionary<TValue> with string keys and items of type
TValue
and populates it with key-value pairs from supplied key-value collection.
- CharSpanLookupReadOnlyDictionary(IReadOnlyDictionary<string, TValue?>)
Creates a new CharSpanLookupReadOnlyDictionary<TValue> with string keys and items of type
TValue
and populates it with key-value pairs from supplied dictionary.
Properties
- Count
Gets the total number of items in this dictionary.
- this[ReadOnlySpan<char>]
Gets a value corresponding to given key in this dictionary.
- this[string]
Gets a value corresponding to given key in this dictionary.
- Keys
Gets the collection of all keys present in this dictionary.
- Values
Gets the collection of all values present in this dictionary.
Methods
- ContainsKey(ReadOnlySpan<char>)
Checks whether this dictionary contains the specified key.
- ContainsKey(string)
Checks whether this dictionary contains the specified key.
- GetEnumerator()
Gets an enumerator over key-value pairs in this dictionary.
- TryGetValue(ReadOnlySpan<char>, out TValue?)
Attempts to retrieve a value corresponding to the supplied key from this dictionary.
- TryGetValue(string, out TValue?)
Attempts to retrieve a value corresponding to the supplied key from this dictionary.
Explicit Interface Implementations
- IEnumerable.GetEnumerator()
Gets the enumerator.