singleton-trait

Crates.iosingleton-trait
lib.rssingleton-trait
version0.4.0
sourcesrc
created_at2021-07-09 18:20:08.938297
updated_at2022-05-07 18:35:34.357177
descriptionSingleton trait for types with unique values and Erased type for zero-sized ownership proofs
homepage
repositoryhttps://gitlab.com/jcarr0/singleton-trait
max_upload_size
id420854
size16,154
Jason Carr (jasoncarr0)

documentation

README

Version 0.4.0 MIT License

This library provides simple unsafe traits for types with global uniqueness properties, as well as the Erased class for proofs. This crate does not provide implementation strategies, but does provide several examples of valid implementers.

Primarily, it is intended to be used for ghost proofs, in which ownership of a value of particular type is sufficient in order for other safety conditions.

The type Erased<T> and the trait Exists<T> are additionally provided as zero-sized proofs of ownership of a type (including references) when existence is enough for safety.

Commit count: 56

cargo fmt