Non-copying constructors and extractors for Buf.ByteArray.
Non-copying constructors and extractors for Buf.ByteArray.
The "owned" APIs may provide direct access to a Buf's underlying implementation; and so mutating the underlying data structure invalidates a Buf's immutability constraint. Users must take care to handle this data immutably.
Shared for analogs that make defensive copies.
Copying constructors and extractors for Buf.ByteArray.
Copying constructors and extractors for Buf.ByteArray.
A "shared" Buf means that steps are taken to ensure that the produced Buf shares no state with the producer. This typically implies defensive copying and should be used when you do not control the lifecycle or usage of the passed in data.
Owned for analogs that do not make defensive copies.
Construct a buffer representing the given bytes.
Construct a buffer representing the given bytes.
The contract is that these bytes will not be modified after this has been called.
Safely coerce a buffer to a Buf.ByteArray, potentially without copying its underlying data.