Struct haproxy_api::Proxy

source ·
pub struct Proxy<'lua> {
    pub name: String,
    pub uuid: String,
    pub stktable: Option<StickTable<'lua>>,
    /* private fields */
}
Expand description

The “Proxy” class provides a way for manipulating proxy and retrieving information like statistics.

Fields§

§name: String§uuid: String§stktable: Option<StickTable<'lua>>

Implementations§

source§

impl<'lua> Proxy<'lua>

source

pub fn pause(&self) -> Result<()>

Pauses the proxy. See the management socket documentation for more information.

source

pub fn resume(&self) -> Result<()>

Resumes the proxy. See the management socket documentation for more information.

source

pub fn stop(&self) -> Result<()>

Stops the proxy. See the management socket documentation for more information.

source

pub fn shut_bcksess(&self) -> Result<()>

Kills the session attached to a backup server. See the management socket documentation for more information.

source

pub fn get_cap(&self) -> Result<ProxyCapability>

Returns a enum describing the capabilities of the proxy.

source

pub fn get_mode(&self) -> Result<ProxyMode>

Returns a enum describing the mode of the current proxy.

source

pub fn get_stats(&self) -> Result<Table<'lua>>

Returns a table containing the proxy statistics. The statistics returned are not the same if the proxy is frontend or a backend.

source

pub fn servers(&self) -> Result<HashMap<String, Server<'lua>>>

Returns a map with the attached servers. The map is indexed by server name.

Trait Implementations§

source§

impl<'lua> Clone for Proxy<'lua>

source§

fn clone(&self) -> Proxy<'lua>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'lua> FromLua<'lua> for Proxy<'lua>

source§

fn from_lua(value: Value<'lua>, lua: &'lua Lua) -> Result<Self>

Performs the conversion.

Auto Trait Implementations§

§

impl<'lua> !RefUnwindSafe for Proxy<'lua>

§

impl<'lua> !Send for Proxy<'lua>

§

impl<'lua> !Sync for Proxy<'lua>

§

impl<'lua> Unpin for Proxy<'lua>

§

impl<'lua> !UnwindSafe for Proxy<'lua>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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<'lua, T> FromLuaMulti<'lua> for Twhere T: FromLua<'lua>,

source§

fn from_lua_multi(values: MultiValue<'lua>, lua: &'lua Lua) -> Result<T, Error>

Performs the conversion. Read more
source§

fn from_lua_args( args: MultiValue<'lua>, i: usize, to: Option<&str>, lua: &'lua Lua ) -> Result<T, Error>

source§

unsafe fn from_stack_multi(nvals: i32, lua: &'lua Lua) -> Result<T, Error>

source§

unsafe fn from_stack_args( nargs: i32, i: usize, to: Option<&str>, lua: &'lua Lua ) -> Result<T, Error>

source§

impl<T, U> Into<U> for Twhere 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> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.