Struct cometbft_testgen::header::Header
source · pub struct Header {
pub validators: Option<Vec<Validator>>,
pub next_validators: Option<Vec<Validator>>,
pub chain_id: Option<String>,
pub height: Option<u64>,
pub time: Option<Time>,
pub proposer: Option<usize>,
pub last_block_id_hash: Option<Hash>,
pub app_hash: Option<AppHash>,
}
Fields§
§validators: Option<Vec<Validator>>
§next_validators: Option<Vec<Validator>>
§chain_id: Option<String>
§height: Option<u64>
§time: Option<Time>
§proposer: Option<usize>
§last_block_id_hash: Option<Hash>
§app_hash: Option<AppHash>
Implementations§
source§impl Header
impl Header
pub fn new(validators: &[Validator]) -> Self
pub fn validators(self, validators: &[Validator]) -> Self
pub fn next_validators(self, next_validators: &[Validator]) -> Self
pub fn chain_id(self, chain_id: &str) -> Self
pub fn height(self, height: u64) -> Self
pub fn time(self, time: Time) -> Self
pub fn proposer(self, proposer: usize) -> Self
pub fn last_block_id_hash(self, last_block_id_hash: Hash) -> Self
pub fn app_hash(self, app_hash: AppHash) -> Self
pub fn next(&self) -> Self
Trait Implementations§
source§impl<'de> Deserialize<'de> for Header
impl<'de> Deserialize<'de> for Header
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Generator<Header> for Header
impl Generator<Header> for Header
source§fn merge_with_default(self, default: Self) -> Self
fn merge_with_default(self, default: Self) -> Self
Merge this companion with the another, default one.
The options present in this object will override those in the default one.
source§impl Options for Header
impl Options for Header
source§fn parse<__S: AsRef<str>>(_parser: &mut Parser<'_, __S>) -> Result<Self, Error>
fn parse<__S: AsRef<str>>(_parser: &mut Parser<'_, __S>) -> Result<Self, Error>
Parses arguments until the given parser is exhausted or until
an error is encountered.
source§fn command(&self) -> Option<&dyn Options>
fn command(&self) -> Option<&dyn Options>
Returns the subcommand instance, if present. Read more
source§fn command_name(&self) -> Option<&'static str>
fn command_name(&self) -> Option<&'static str>
Returns the name of a parsed command, if present. Read more
source§fn help_requested(&self) -> bool
fn help_requested(&self) -> bool
Returns whether the user supplied a “help” option to request
usage information about the program or any contained subcommands. Read more
source§fn parse_command<__S: AsRef<str>>(
name: &str,
_parser: &mut Parser<'_, __S>
) -> Result<Self, Error>
fn parse_command<__S: AsRef<str>>( name: &str, _parser: &mut Parser<'_, __S> ) -> Result<Self, Error>
Parses options for the named command.
source§fn usage() -> &'static str
fn usage() -> &'static str
Returns a string showing usage and help for each supported option. Read more
source§fn self_usage(&self) -> &'static str
fn self_usage(&self) -> &'static str
Returns a string showing usage and help for this options instance. Read more
source§fn command_list() -> Option<&'static str>
fn command_list() -> Option<&'static str>
Returns a string listing available commands and help text. Read more
source§fn command_usage(_name: &str) -> Option<&'static str>
fn command_usage(_name: &str) -> Option<&'static str>
Returns a usage string for the named command. Read more
source§fn self_command_list(&self) -> Option<&'static str>
fn self_command_list(&self) -> Option<&'static str>
Returns a listing of available commands and help text. Read more
source§fn parse_args<S>(args: &[S], style: ParsingStyle) -> Result<Self, Error>
fn parse_args<S>(args: &[S], style: ParsingStyle) -> Result<Self, Error>
Parses arguments received from the command line. Read more
source§fn parse_args_or_exit(style: ParsingStyle) -> Selfwhere
Self: Sized,
fn parse_args_or_exit(style: ParsingStyle) -> Selfwhere
Self: Sized,
Parses arguments from the environment. Read more
source§fn parse_args_default_or_exit() -> Selfwhere
Self: Sized,
fn parse_args_default_or_exit() -> Selfwhere
Self: Sized,
Parses arguments from the environment, using the default
parsing style. Read more
Auto Trait Implementations§
impl RefUnwindSafe for Header
impl Send for Header
impl Sync for Header
impl Unpin for Header
impl UnwindSafe for Header
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