Module resource

Source
Expand description

Manage a resource that can be started, stopped, and destroyed – i.e. a Subject – and which has different facets depending on whether it is locked exclusively, shared between multiple users, or unlocked/free.

For example, a resource representing a PostgreSQL cluster would allow start, stop, and destroy actions only when it is exclusively locked. The type of an unlocked cluster resource or a shared cluster resource would not even have functions available to start, stop, or destroy the cluster.

The intent is to codify safe behaviours into Rust’s type system so that we make it hard or impossible to mishandle a resource – and conversely, easier to correctly handle a resource.

Structs§

ResourceExclusive
A resource held exclusively.
ResourceFree
An unlocked/free resource.
ResourceShared
A shared resource.

Traits§

FacetExclusive
FacetFree
FacetShared