/// <inheritdoc /> public override bool ConcurrentWriter(ref Key key, ref SpanByte input, ref SpanByte src, ref SpanByte dst, ref Output output, ref UpsertInfo upsertInfo) { if (dst.Length < src.Length) { return(false); } // We can adjust the length header on the serialized log, if we wish. // This method will also zero out the extra space to retain log scan correctness. dst.UnmarkExtraMetadata(); dst.ShrinkSerializedLength(src.Length); // Write the source data, leaving the destination size unchanged. You will need // to mange the actual space used by the value if you stop here. src.CopyTo(ref dst); return(true); }
/// <summary> /// Blindly copy to given pre-allocated SpanByte, assuming sufficient space. /// Does not change length of destination. /// </summary> /// <param name="dst"></param> public void CopyTo(ref SpanByte dst) { dst.UnmarkExtraMetadata(); dst.ExtraMetadata = ExtraMetadata; AsReadOnlySpan().CopyTo(dst.AsSpan()); }