fn new(
        protocol: Box<ProtocolGen>,
        rate: Option<u64>,
        queue: Vec<Queue<Vec<u8>>>,
        stats: Sender<Stat>,
        clocksource: Clocksource,
    ) -> Result<Workload, &'static str> {
        let mut ratelimit = None;
        if let Some(r) = rate {
            if r > 0 {
                ratelimit = Some(
                    ratelimit::Builder::new()
                        .frequency(r as u32)
                        .capacity(BUCKET_SIZE as u32)
                        .build(),
                );
            }
        }
        Ok(Workload {
            protocol: protocol,
            ratelimit: ratelimit,
            queue: queue,
            stats: stats,
            clocksource: clocksource,
        })
    }
/// Create a new `Workload` based on a protocol, optional rate, and a queue
Create a new `Workload` based on a protocol, optional rate, and a queue
Create a new ` Workload ` based on a protocol optional rate and a queue
fn new(
        protocol: Box<ProtocolGen>,
        rate: Option<u64>,
        queue: Vec<Queue<Vec<u8>>>,
        stats: Sender<Stat>,
        clocksource: Clocksource,
    ) -> Result<Workload, &'static str> {
        let mut ratelimit = None;
        if let Some(r) = rate {
            if r > 0 {
                ratelimit = Some(
                    ratelimit::Builder::new()
                        .frequency(r as u32)
                        .capacity(BUCKET_SIZE as u32)
                        .build(),
                );
            }
        }
        Ok(Workload {
            protocol: protocol,
            ratelimit: ratelimit,
            queue: queue,
            stats: stats,
            clocksource: clocksource,
        })
    }
fn new ( protocol : Box < ProtocolGen > , rate : Option < u64 > , queue : Vec < Queue < Vec < u8 > > > , stats : Sender < Stat > , clocksource : Clocksource , ) -> Result < Workload , & ' static str > { let mut ratelimit = None ; if let Some ( r ) = rate { if r > 0 { ratelimit = Some ( ratelimit :: Builder :: new ( ) . frequency ( r as u32 ) . capacity ( BUCKET_SIZE as u32 ) . build ( ) , ) ; } } Ok ( Workload { protocol : protocol , ratelimit : ratelimit , queue : queue , stats : stats , clocksource : clocksource , } ) }
Create a new `Workload` based on a protocol, optional rate, and a queue
Create a new ` Workload ` based on a protocol optional rate and a queue
protocol
Box<ProtocolGen>
rate
Option<u64>
queue
Vec<Queue<Vec<u8>>>
stats
Sender<Stat>
clocksource
Clocksource
protocol
Box<ProtocolGen>
rate
Option<u64>
queue
Vec<Queue<Vec<u8>>>
stats
Sender<Stat>
clocksource
Clocksource