Struct haproxy_api::Txn[][src]

pub struct Txn<'lua> {
    pub c: Converters<'lua>,
    pub f: Fetches<'lua>,
    // some fields omitted
}
Expand description

The txn class contain all the functions relative to the http or tcp transaction.

Fields

c: Converters<'lua>f: Fetches<'lua>

Implementations

impl<'lua> Txn<'lua>[src]

pub fn http(&self) -> Result<Http<'lua>>[src]

Returns an HTTP class object.

pub fn log<S: ?Sized>(&self, level: LogLevel, msg: &S) -> Result<()> where
    S: AsRef<str>, 
[src]

Sends a log on the default syslog server if it is configured and on the stderr if it is allowed.

pub fn deflog<S: ?Sized>(&self, msg: &S) -> Result<()> where
    S: AsRef<str>, 
[src]

Sends a log line with the default loglevel for the proxy associated with the transaction.

pub fn get_priv<R: FromLua<'lua>>(&self) -> Result<R>[src]

Returns data stored in the current transaction (with the set_priv()) function.

pub fn set_priv<A: ToLua<'lua>>(&self, val: A) -> Result<()>[src]

Stores any data in the current HAProxy transaction. This action replaces the old stored data.

pub fn get_var<R: FromLua<'lua>>(&self, name: &str) -> Result<R>[src]

Returns data stored in the variable name.

pub fn set_var<A: ToLua<'lua>>(&self, name: &str, val: A) -> Result<()>[src]

Store variable name in an HAProxy converting the type.

pub fn unset_var(&self, name: &str) -> Result<()>[src]

Unsets the variable name.

pub fn set_loglevel(&self, level: LogLevel) -> Result<()>[src]

Changes the log level of the current request. The level must be an integer between 0 and 7.

Trait Implementations

impl<'lua> Clone for Txn<'lua>[src]

fn clone(&self) -> Txn<'lua>[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<'lua> FromLua<'lua> for Txn<'lua>[src]

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

Performs the conversion.

Auto Trait Implementations

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

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

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

impl<'lua> Unpin for Txn<'lua>

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

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<'lua, T> FromLuaMulti<'lua> for T where
    T: FromLua<'lua>, 
[src]

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

Performs the conversion. Read more

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

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

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

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

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.

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

Performs the conversion.

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.

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

Performs the conversion.