pub struct CommonClientArgs {
pub timeout_secs: u64,
pub server: String,
pub search_addr: String,
pub bind_addr: String,
pub name_server: String,
pub udp_port: u16,
pub tcp_port: u16,
pub debug: bool,
pub no_broadcast: bool,
pub authnz_user: String,
pub authnz_host: String,
}Expand description
Common CLI arguments shared across all PVA client tools.
Usage:
ⓘ
let mut common = CommonClientArgs::new();
// optionally adjust defaults before parsing:
// common.timeout_secs = 3;
{
let mut ap = ArgumentParser::new();
common.add_to_parser(&mut ap);
// add tool-specific args here
ap.parse_args_or_exit();
}
common.init_tracing();
let opts = common.into_pv_get_options("myPV".to_string())?;Fields§
§timeout_secs: u64§server: String§search_addr: String§bind_addr: String§name_server: String§udp_port: u16§tcp_port: u16§debug: bool§no_broadcast: bool§authnz_user: String§authnz_host: StringImplementations§
Source§impl CommonClientArgs
impl CommonClientArgs
pub fn new() -> Self
Sourcepub fn add_to_parser<'a, 'b>(&'a mut self, ap: &'b mut ArgumentParser<'a>)
pub fn add_to_parser<'a, 'b>(&'a mut self, ap: &'b mut ArgumentParser<'a>)
Register common flags on the given parser.
Short flags -w and -d are included so that tools like pvlist
that historically accepted them keep working.
Sourcepub fn init_tracing(&self)
pub fn init_tracing(&self)
Initialise the tracing_subscriber based on --debug.
Sourcepub fn into_pv_get_options(
self,
pv_name: String,
) -> Result<PvGetOptions, Box<dyn Error>>
pub fn into_pv_get_options( self, pv_name: String, ) -> Result<PvGetOptions, Box<dyn Error>>
Convert the parsed CLI strings into a ready-to-use PvGetOptions.
Auto Trait Implementations§
impl Freeze for CommonClientArgs
impl RefUnwindSafe for CommonClientArgs
impl Send for CommonClientArgs
impl Sync for CommonClientArgs
impl Unpin for CommonClientArgs
impl UnsafeUnpin for CommonClientArgs
impl UnwindSafe for CommonClientArgs
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