docs: Document that ByteBuffer is a value type (#3676)

Fixes #3037

Co-authored-by: Wasim <wasim@example.com>
This commit is contained in:
MOHAMMED WASIM KHANandWasim authored and GitHub committed 2026-08-28 13:38:09 +00:00
1 parent 7800d84cba
commit a931f2c1de
1 file changed
+5
+5
View File
@@ -190,6 +190,11 @@ public struct ByteBufferAllocator: Sendable {
/// `ByteBuffer` stores contiguously allocated raw bytes. It is a random and sequential accessible sequence of zero or
/// more bytes (octets).
///
/// ### Value Semantics
/// `ByteBuffer` is a value type. The reader and writer indices can always be modified without a
/// copy of the underlying data. Any data modification may need to copy the contents using
/// copy-on-write if there are multiple references to the underlying data storage.
///
/// ### Allocation
/// Use `allocator.buffer(capacity: desiredCapacity)` to allocate a new `ByteBuffer`.
///