Struct exonum::helpers::fabric::Context
[−]
[src]
pub struct Context { /* fields omitted */ }
Context
is a type, used to keep some values from Command
into
CommandExtension
and vice verse.
Methods
impl Context
[src]
fn arg<T: FromStr>(&self, key: &str) -> Result<T, Box<Error>> where
<T as FromStr>::Err: Error + 'static,
[src]
<T as FromStr>::Err: Error + 'static,
Gets value of the command line argument.
fn arg_multiple<T: FromStr>(&self, key: &str) -> Result<Vec<T>, Box<Error>> where
<T as FromStr>::Err: Error + 'static,
[src]
<T as FromStr>::Err: Error + 'static,
Gets multiple values of the command line argument.
fn get<'de, T: Deserialize<'de>>(&self, key: &str) -> Result<T, Box<Error>>
[src]
Gets the variable from the context.
fn set<T: Serialize>(&mut self, key: &'static str, value: T) -> Option<Value>
[src]
Sets the variable in the context and returns the previous value.
Panic
Panics if value could not be serialized as TOML.
Trait Implementations
impl PartialEq for Context
[src]
fn eq(&self, __arg_0: &Context) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Context) -> bool
[src]
This method tests for !=
.
impl Debug for Context
[src]
impl Clone for Context
[src]
fn clone(&self) -> Context
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more