pub struct Context { /* fields omitted */ }
Context
is a type, used to keep some values from Command
into
CommandExtension
and vice verse.
To access values stored inside Context, use ContextKey
.
use exonum::node::NodeConfig;
use exonum::helpers::fabric::{keys, Context};
fn get_node_config(context: &Context) -> NodeConfig {
context.get(keys::NODE_CONFIG).unwrap()
}
Gets value of the command line argument.
Inserts value to the command line arguments map.
Gets multiple values of the command line argument.
Inserts multiple values to the command line arguments map.
Gets the variable from the context.
Sets the variable in the context and returns the previous value.
Panics if value could not be serialized as TOML.
Returns the "default value" for a type. Read more
This method tests for self
and other
values to be equal, and is used by ==
. Read more
This method tests for !=
.
Performs copy-assignment from source
. Read more
Formats the value using the given formatter. Read more
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
impl<T> Clear for T where T: InitializableFromZeroed + ?Sized, | |
Completely overwrites this value.
impl<T> InitializableFromZeroed for T where T: Default, | |
Called to initialize a place to a valid value, after it is set to all-bits-zero. Read more