Struct haproxy_api::Server

source ·
pub struct Server<'lua> {
    pub name: String,
    pub puid: String,
    /* private fields */
}
Expand description

The “Server” class provides a way for manipulating servers and retrieving information.

Fields§

§name: String§puid: String

Implementations§

source§

impl<'lua> Server<'lua>

source

pub fn is_draining(&self) -> Result<bool>

Returns true if the server is currently draining sticky connections.

source

pub fn set_maxconn(&self, maxconn: u64) -> Result<()>

Dynamically changes the maximum connections of the server.

source

pub fn get_maxconn(&self) -> Result<u64>

Returns an integer representing the server maximum connections.

source

pub fn set_weight(&self, weight: &str) -> Result<()>

Dynamically changes the weight of the server. See the management socket documentation for more information about the format of the string.

source

pub fn get_weight(&self) -> Result<u32>

Returns an integer representing the server weight.

source

pub fn set_addr(&self, addr: String, port: Option<u16>) -> Result<()>

Dynamically changes the address of the server.

source

pub fn get_addr(&self) -> Result<String>

Returns a string describing the address of the server.

source

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

Returns a table containing the server statistics.

source

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

Shutdowns all the sessions attached to the server.

source

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

Drains sticky sessions.

source

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

Sets maintenance mode.

source

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

Sets normal mode.

source

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

Enables health checks.

source

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

Disables health checks.

source

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

Forces health-check up.

source

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

Forces health-check nolb mode.

source

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

Forces health-check down.

source

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

Enables agent check.

source

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

Disables agent check.

source

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

Forces agent check up.

source

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

Forces agent check down.

Trait Implementations§

source§

impl<'lua> Clone for Server<'lua>

source§

fn clone(&self) -> Server<'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 Server<'lua>

source§

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

Performs the conversion.

Auto Trait Implementations§

§

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

§

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

§

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

§

impl<'lua> Unpin for Server<'lua>

§

impl<'lua> !UnwindSafe for Server<'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.