Crate call_once

Source
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ยง

CallOnce
A type that can only be called successfully once.
CallOnceError
The CallOnceError error indicates that CallOnce::call_once has been called more than once.