using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
Console.WriteLine(new { res?.b });
ref readonly T AsRef<T>() where T : struct => ref MemoryMarshal.AsRef<T>(res.Value.bin);
ref readonly var aa = ref AsRef<a>();
Console.WriteLine(new { aa.b });
ref readonly T AsRef<T>() where T : struct => ref MemoryMarshal.AsRef<T>(res.Value.bin);
ref readonly var aa = ref AsRef<a>();
Console.WriteLine(new { aa });
ref readonly T AsRef<T>() where T : struct => ref MemoryMarshal.AsRef<T>(res.Value.bin);
Console.WriteLine(new { aa.b });
ref readonly a AsRef() => ref MemoryMarshal.AsRef<a>(res.Value.bin);
Console.WriteLine(new { aa.b });
ref readonly var aa = ref MemoryMarshal.AsRef<a>(res.Value.bin);
Console.WriteLine(new { aa.b });
record struct a(UInt16 b) {
public ReadOnlySpan<byte> bin => MemoryMarshal.AsBytes(new ReadOnlySpan<a>(in Unsafe.AsRef(in this)));