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

ReadLeaseT 结构

表示读取操作的租约结构体。

Definition

命名空间: TouchSocket.Core
程序集: TouchSocket.Core (在 TouchSocket.Core.dll 中) 版本:4.0.0-beta.143+5fcca7a4e70968794985dc3793adc50531308be6
C#
public readonly struct ReadLease<T> : IDisposable
Inheritance
Object    ValueType    ReadLeaseT
Implements
IDisposable

类型参数

T
租约中包含的值的类型。

备注

ReadLease是一个只读结构体,用于管理读取操作的生命周期和资源释放。 当调用Dispose方法时表示消费完成,会触发相应的清理操作。 此结构体实现了IDisposable接口以支持资源管理模式。

属性

IsCompleted 获取一个值,指示读取操作是否已完成。
Value 获取租约中包含的值。

方法

Dispose 释放租约相关的资源。
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。)
ToStringReturns the fully qualified type name of this instance.
(继承自 ValueType。)

扩展方法

Map 将源对象的属性映射到目标对象的属性中。
(由 Mapper 定义。)
Map 将源对象映射到目标类型的实例。
(由 Mapper 定义。)
MapTTarget 将源对象映射到指定目标类型的新实例。
(由 Mapper 定义。)
SafeDispose 安全性释放(不用判断对象是否为空)。不会抛出任何异常。
(由 SystemExtension 定义。)
ToJsonString 转换为Json
(由 SerializeConvert 定义。)

参见