Skip to main content

oxilean_runtime/lazy_eval/
once_traits.rs

1//! # Once - Trait Implementations
2//!
3//! This module contains trait implementations for `Once`.
4//!
5//! ## Implemented Traits
6//!
7//! - `Default`
8//! - `Debug`
9//!
10//! 🤖 Generated with [SplitRS](https://github.com/cool-japan/splitrs)
11
12use super::types::Once;
13use std::fmt;
14
15impl<T: Clone + fmt::Debug + Send + Sync + 'static> Default for Once<T> {
16    fn default() -> Self {
17        Self::new()
18    }
19}
20
21impl<T: Clone + fmt::Debug + Send + Sync + 'static> fmt::Debug for Once<T> {
22    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
23        match self.inner.get() {
24            Some(v) => write!(f, "Once::Initialized({:?})", v),
25            None => write!(f, "Once::Uninitialized"),
26        }
27    }
28}