Enum ScyllaCollectionCapabilities
A FlagsAttribute bitfield enumeration that describes which optional operations a Scylla collection instance supports at runtime.
Namespace: Scylla.Core.Structures
Assembly: ScyllaCore.dll
Syntax
[Flags]
public enum ScyllaCollectionCapabilities
Remarks
These flags enable feature detection without requiring type-casting or reflection. Query Capabilities on any collection and test the returned value against the flags below before calling the corresponding operation through the abstract interface.
Flags are combined with bitwise OR and tested with bitwise AND:
var caps = collection.Capabilities;
if ((caps & ScyllaCollectionCapabilities.SupportsPeek) != 0)
{
// Safe to call IScyllaCollection<T>.TryPeek
}
if ((caps & ScyllaCollectionCapabilities.HasCapacity) != 0)
{
// The collection has a bounded capacity; TryAdd may return false when full.
}
Synchronized wrappers cache the capability flags of their inner collection at construction time. The Capabilities property on a wrapper is therefore stable and does not require synchronization to read.
Fields
| Name | Description |
|---|---|
| HasCapacity | The collection has a bounded capacity concept, meaning it tracks a maximum number of elements it can hold before becoming "full". Examples include fixed-capacity arrays, ring buffers, and object pools. |
| None | No optional capabilities are supported. Only the base IScyllaCollection contract - Count, IsEmpty, and Clear() - is available. |
| SupportsContains | The collection supports a membership test that determines whether a given item is currently stored in the collection. Examples include queues, stacks, and ring buffers (all via linear search, O(n)). |
| SupportsCopyTo | The collection supports copying its current elements out to a user-provided buffer (an array or Span<T>) via CopyTo(Span<T>) and CopyTo(T[], int). |
| SupportsKeyLookup | The collection supports fast key-based lookup, meaning elements can be retrieved by an
associated key in sub-linear time. Examples include dictionaries, hash maps, and indexed
collections such as |
| SupportsPeek | The collection supports inspecting the "next" item - the one that would be returned by TryRemove(out T) - without removing it. Examples include queues, stacks, deques, and ring buffers. |
| SupportsRandomAccess | The collection supports random access by zero-based integer index, allowing elements to be read or written at an arbitrary position in O(1) time. Examples include list-like structures backed by contiguous arrays. |