Struct noxious_client::Client [−][src]
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]
&self,
name: &str,
listen: &str,
upstream: &str
) -> Result<Proxy, ClientError>
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]
&self,
proxies: &[ProxyConfig]
) -> Result<Vec<Proxy>, ClientError>
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
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,