Struct noxious_client::Client[][src]

pub struct Client { /* fields omitted */ }

A client for Noxious and Toxiproxy It follows the same naming conventions for the methods.

Implementations

impl Client[src]

pub fn new(url: &str) -> Client[src]

Create a new client

Panics if the given url starts with https://.

pub async fn proxy(&self, name: &str) -> Result<Proxy, ClientError>[src]

Returns a proxy by name, if it already exists

pub async fn proxies(&self) -> Result<HashMap<String, Proxy>, ClientError>[src]

Returns a map with all the proxies and their toxics

pub async fn create_proxy(
    &self,
    name: &str,
    listen: &str,
    upstream: &str
) -> Result<Proxy, ClientError>
[src]

Instantiates a new proxy config, sends it to the server The server starts listening on the specified address

pub async fn populate(
    &self,
    proxies: &[ProxyConfig]
) -> Result<Vec<Proxy>, ClientError>
[src]

Create a list of proxies using a configuration list. If a proxy already exists, it will be replaced with the specified configuration.

pub async fn reset_state(&self) -> Result<(), ClientError>[src]

Resets the state of all proxies by removing all the toxic from all proxies

Trait Implementations

impl Debug for Client[src]

Auto Trait Implementations

impl RefUnwindSafe for Client

impl Send for Client

impl Sync for Client

impl Unpin for Client

impl UnwindSafe for Client

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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