namespace Brutal.SlangApi;
///
/// Hand-written ergonomic helpers on top of the generated
/// COM interface. The interface itself only exposes a raw void* + size pair;
/// callers shouldn't have to assemble a span by hand to read the contents.
///
public static unsafe partial class ISlangBlobExtensions
{
///
/// Returns the blob's contents as a . The span is
/// valid for the lifetime of the underlying blob. Copy if you need the bytes
/// to outlive it.
///
public static ReadOnlySpan AsSpan(this ISlangBlob self) =>
new(self.GetBufferPointer(), checked((int)self.GetBufferSize()));
}