Add trait for single unlocking of an item

Add a trait serving a lock which features only an irreversible unlocking
of an item. Such a type may be used to pass around locked items while
permitting the user to unlock them and perform any operation with a copy
of the original item.
This commit is contained in:
Julian Ganz 2016-01-16 06:41:56 +01:00
parent 33f097d662
commit 6c2962efe9

View file

@ -0,0 +1,5 @@
pub trait SingleUseLock<T> {
fn access(&self) -> &T;
fn unlock(self) -> T;
}