Expand description
This crate provides CallOnce
, a simple, thread-safe type that can only be called successfully once:
use call_once::CallOnce;
static CALL_ONCE: CallOnce = CallOnce::new();
assert!(CALL_ONCE.call_once().is_ok());
assert!(CALL_ONCE.call_once().is_err());
Structs
- A type that can only be called successfully once.
- The
CallOnceError
error indicates thatCallOnce::call_once
has been called more than once.