Struct grin_core::global::GLOBAL_CHAIN_TYPE[][src]

pub struct GLOBAL_CHAIN_TYPE { /* fields omitted */ }

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>>

pub fn init(&self, value: T)[src]

Initializes the OneTime, should only be called once after construction. Will panic (via assert) if called more than once.

pub fn borrow(&self) -> T[src]

Borrows the OneTime, should only be called after initialization. Will panic (via expect) if called before initialization.

pub fn is_init(&self) -> bool[src]

Has this OneTime been initialized?

Trait Implementations

impl Deref for GLOBAL_CHAIN_TYPE[src]

type Target = OneTime<ChainTypes>

The resulting type after dereferencing.

fn deref(&self) -> &OneTime<ChainTypes>[src]

Dereferences the value.

impl LazyStatic for GLOBAL_CHAIN_TYPE[src]

fn initialize(lazy: &Self)[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<T> UnsafeAny for T where
    T: Any