public ReadOnlySpan <byte> AsBytes() { return(SpanHelpers.AsByteSpan(ref this)); }
/// <summary> /// Returns a view of the element at index <paramref name="elementIndex"/> as a <see cref="Span{T}"/> of bytes. /// </summary> /// <param name="elementIndex">The zero-based index of the element.</param> /// <returns>A byte span representation of the element.</returns> public Span <byte> GetByteSpan(int elementIndex) { return(SpanHelpers.AsByteSpan(ref _buffer[elementIndex])); }
public BlitStruct(ref T data) { _buffer = SpanHelpers.AsSpan(ref data); }
public static void ReleaseGuard(ref nint guard, object mutex) { SpanHelpers.AsByteSpan(ref guard)[0] = GuardBitComplete; ReleaseInitByte(ref Unsafe.As <byte, InitStatus>(ref SpanHelpers.AsByteSpan(ref guard)[1]), mutex); }