一款简单易用的基础网络通讯组件库。

WriterAnchorTWriter 结构

表示字节写入器的锚点,用于记录特定位置和获取对应的字节跨度。

Definition

命名空间: TouchSocket.Core
程序集: TouchSocket.Core (在 TouchSocket.Core.dll 中) 版本:4.0.0-beta.143+5fcca7a4e70968794985dc3793adc50531308be6
C#
public readonly ref struct WriterAnchor<TWriter>
where TWriter : IBytesWriter
Inheritance
Object    ValueType    WriterAnchorTWriter

类型参数

TWriter
实现IBytesWriter接口的字节写入器类型。

备注

WriterAnchor是一个只读的ref结构体,用于在字节写入操作中标记特定位置, 并在后续操作中能够回退到该位置或获取从该位置开始的字节跨度。 支持版本检查以确保数据一致性,并提供回退功能用于高级字节写入场景。

构造函数

WriterAnchorTWriter 初始化写入器锚点的新实例。

方法

EqualsIndicates whether this instance and a specified object are equal.
(继承自 ValueType。)
GetHashCodeReturns the hash code for this instance.
(继承自 ValueType。)
GetTypeGets the Type of the current instance.
(继承自 Object。)
Rewind 回退到锚点位置并获取对应的字节跨度。
ToStringReturns the fully qualified type name of this instance.
(继承自 ValueType。)

扩展方法

Map 将源对象的属性映射到目标对象的属性中。
(由 Mapper 定义。)
Map 将源对象映射到目标类型的实例。
(由 Mapper 定义。)
MapTTarget 将源对象映射到指定目标类型的新实例。
(由 Mapper 定义。)
ToJsonString 转换为Json
(由 SerializeConvert 定义。)

参见