mirai
2.16.0
common
mirai-core-api
/
net.mamoe.mirai.utils
/
withAutoClose
with
Auto
Close
@
MiraiExperimentalApi
inline
fun
<
T
:
ExternalResource
,
R
>
T
.
withAutoClose
(
action
:
(
)
->
R
)
:
R
执行
action
, 如果
ExternalResource.isAutoClose
, 在执行完成后调用 ExternalResource.close.
Since
2.8