Expand description
§Introduction
This crate provides safe references with runtime-checked lifetimes. While a reference is in use, attempts to drop the referenced value will block.
The main entry-point for this library is the Scope struct.
Additional examples are available in the examples module.
§Features
| Feature | Default | Description |
|---|---|---|
| docs | no | Used internally when building documentation. |
§Similar Crates
- The lien crate provides a similar construction without weak references
but with a more flexible API and
no_stdsupport. - The scoped_reference crate provides runtime checked references that aborts the program (without first running panic handlers) on violations. This is preferable to deadlocking, especially in single-threaded use cases.
Modules§
- examples
- This module contains example use cases and is only included when building the documentation.
Structs§
- Assigned
Error - Returned when
Scope::assign()is called un an already assignedScope. - Scope
- Manages the lifetime of scoped references created with this library.
- Strong
Ref - A strong reference obtained from a
Scope. - WeakRef
- A weak reference obtained from a
Scope.