Trait portus::CongAlgBuilder
source · pub trait CongAlgBuilder<'a> {
// Required methods
fn args() -> App<'a>;
fn with_arg_matches(args: &ArgMatches) -> Result<Self>
where Self: Sized;
}
Expand description
Tell portus
how to construct instances of your impl
[portus::CongAlg
].
You should also annotate your struct with portus_export::register_ccp_alg
).
Required Methods§
sourcefn args() -> App<'a>
fn args() -> App<'a>
This function should return a new
clap::App
that describes the
arguments this algorithm needs to create an instance of itself.
sourcefn with_arg_matches(args: &ArgMatches) -> Result<Self>where
Self: Sized,
fn with_arg_matches(args: &ArgMatches) -> Result<Self>where Self: Sized,
This function takes as input the set of parsed arguments and uses them to parameterize a
new instance of this congestion control algorithm. The matches will be derived from
running Clap::App::get_matches_from
on the clap::App
returned by the register
function.
It also takes an instsance of a logger so that the calling program can define the logging
behavior (eg. format and redirection).