Skip to main content

Module resource

Module resource 

Source
Expand description

The Resource trait for I/O handles and other closeable resources.

Resources are ref-counted with Arc (NOT GcPtr) so that they get deterministic cleanup when the last reference drops. The GC has no finalizers, so GcPtr would leak file descriptors.

Structs§

ResourceHandle
A wrapper around Arc<dyn Resource> that provides Clone and Debug.

Traits§

Resource
A closeable, ref-counted resource (file handle, socket, etc.).