Skip to main content

Crate scoped_ref

Crate scoped_ref 

Source
Expand description

Crates.io Version Docs.rs CI Status License

§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

FeatureDefaultDescription
docsnoUsed internally when building documentation.

§Similar Crates

  • The lien crate provides a similar construction without weak references but with a more flexible API and no_std support.
  • 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§

AssignedError
Returned when Scope::assign() is called un an already assigned Scope.
Scope
Manages the lifetime of scoped references created with this library.
StrongRef
A strong reference obtained from a Scope.
WeakRef
A weak reference obtained from a Scope.