Expand description
Uniqueness of types via invariant lifetimes.
Provides a UniqueType
marker which makes it impossible to call the following without resorting to unsafe
code:
fn same_type<'c, T>(t1: UniqueType<'c, T>, t2: UniqueType<'c, T>)
{
panic!("this is impossible!")
}
Structs§
- Gen
- A structure for storing values containing unique types.
- Region
- An invariant lifetime marker.
- Scope
- A covariant lifetime marker.
- Unique
Type - A marker for a type which is guaranteed to be unique within some region of code.
Traits§
- Static
Tuple - A trait implemented by tuples of static types.
- Storable
- The trait of values containing unique types which may be stored.
- TryGen
Tuple - A trait for creating a tuples of unique type markers.
Functions§
- try_
with_ types - Attempt to invoke
f
with an invariant lifetime marker and a tuple of type markers that are unique for that lifetime. - with_
region - Invoke
f
with an invariant lifetime marker. - with_
scope - Invoke
f
with an covariant lifetime marker. - with_
type - Invoke
f
with a type marker which is unique for an invariant lifetime. - with_
types - Like
try_with_types
, but itunwrap
s for you.