Skip to main content

ClientBuilder

Struct ClientBuilder 

Source
pub struct ClientBuilder { /* private fields */ }
Expand description

Builder for Client struct.

Implementations§

Source§

impl ClientBuilder

Source

pub fn new(target: impl Into<String>) -> Self

Create a new client builder with the given target server IP address.

Source

pub fn port(self, port: u16) -> Self

Target port on server (1-65535)

Source

pub fn data(self, data: Option<impl Into<String>>) -> Self

Target size of data to be uploaded/downloaded in the speed test including units (eg, 10MB, 1GB, 2GB). Instead of time.

Source

pub fn time(self, time: u64) -> Self

Time limit per test direction in seconds (1-3600).

Source

pub fn chunk_size(self, chunk_size: impl Into<String>) -> Result<Self>

Buffer size for read/write operations (eg, 32KiB, 64KiB, 128KiB).

Source

pub fn ping_count(self, ping_count: u32) -> Self

Number of pings to perform for ping test (1-1000)

Source

pub fn return_json(self, return_json: bool) -> Self

Return results as json

Source

pub fn timeout(self, timeout: u64) -> Self

Connection timeout in seconds

Source

pub fn retries(self, retries: u32) -> Self

Number of retry attempts on initial connection failure

Source

pub fn quiet(self, quiet: bool) -> Self

Suppress progress output (results & errors only)

Source

pub fn verbose(self, verbose: bool) -> Self

Enable verbose output

Source

pub fn build(self) -> Result<Client>

Complete build of Client.

Trait Implementations§

Source§

impl Debug for ClientBuilder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V