Struct grin_core::global::GLOBAL_CHAIN_TYPE
source · pub struct GLOBAL_CHAIN_TYPE { /* private fields */ }
Expand description
Global chain_type that must be initialized once on node startup. This is accessed via get_chain_type() which allows the global value to be overridden on a per-thread basis (for testing).
Methods from Deref<Target = OneTime<ChainTypes>>§
sourcepub fn init(&self, value: T)
pub fn init(&self, value: T)
Initializes the OneTime, should only be called once after construction. Will panic (via assert) if called more than once.
sourcepub fn set(&self, value: T, is_override: bool)
pub fn set(&self, value: T, is_override: bool)
Allows the one time to be set again with an override.
Trait Implementations§
source§impl Deref for GLOBAL_CHAIN_TYPE
impl Deref for GLOBAL_CHAIN_TYPE
§type Target = OneTime<ChainTypes>
type Target = OneTime<ChainTypes>
The resulting type after dereferencing.
source§fn deref(&self) -> &OneTime<ChainTypes>
fn deref(&self) -> &OneTime<ChainTypes>
Dereferences the value.
impl LazyStatic for GLOBAL_CHAIN_TYPE
Auto Trait Implementations§
impl Freeze for GLOBAL_CHAIN_TYPE
impl RefUnwindSafe for GLOBAL_CHAIN_TYPE
impl Send for GLOBAL_CHAIN_TYPE
impl Sync for GLOBAL_CHAIN_TYPE
impl Unpin for GLOBAL_CHAIN_TYPE
impl UnwindSafe for GLOBAL_CHAIN_TYPE
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more