[][src]Trait portus::CongAlgBuilder

pub trait CongAlgBuilder<'a, 'b> {
    fn args() -> App<'a, 'b>;
fn with_arg_matches(
        args: &ArgMatches,
        logger: Option<Logger>
    ) -> Result<Self>
    where
        Self: Sized
; }

Structs implementing portus::CongAlg must also implement this trait (and must be annotated with portus_export::register_ccp_alg)

The expected use of this trait in a calling program is as follows:

let args = CongAlgBuilder::args();
let matches = app.get_matches_from(std::env::args_os());
let alg = CongAlgBuilder::with_arg_matches(matches);

Required methods

fn args() -> App<'a, 'b>

This function should return a new clap::App that describes the arguments this algorithm needs to create an instance of itself.

fn with_arg_matches(args: &ArgMatches, logger: Option<Logger>) -> 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).

Loading content...

Implementors

Loading content...