Struct haproxy_api::Txn 
source · pub struct Txn<'lua> {
    pub c: Converters<'lua>,
    pub f: Fetches<'lua>,
    /* private fields */
}Expand description
The txn class contain all the functions relative to the http or tcp transaction.
Fields§
§c: Converters<'lua>§f: Fetches<'lua>Implementations§
source§impl<'lua> Txn<'lua>
 
impl<'lua> Txn<'lua>
sourcepub fn log(&self, level: LogLevel, msg: impl AsRef<str>) -> Result<()>
 
pub fn log(&self, level: LogLevel, msg: impl AsRef<str>) -> Result<()>
Sends a log on the default syslog server if it is configured and on the stderr if it is allowed.
sourcepub fn deflog<S>(&self, msg: &S) -> Result<()>where
    S: AsRef<str> + ?Sized,
 
pub fn deflog<S>(&self, msg: &S) -> Result<()>where S: AsRef<str> + ?Sized,
Sends a log line with the default loglevel for the proxy associated with the transaction.
sourcepub fn get_priv<R: FromLua<'lua>>(&self) -> Result<R>
 
pub fn get_priv<R: FromLua<'lua>>(&self) -> Result<R>
Returns data stored in the current transaction (with the set_priv()) function.
sourcepub fn set_priv<A: IntoLua<'lua>>(&self, val: A) -> Result<()>
 
pub fn set_priv<A: IntoLua<'lua>>(&self, val: A) -> Result<()>
Stores any data in the current HAProxy transaction. This action replaces the old stored data.
sourcepub fn get_var<R: FromLua<'lua>>(&self, name: &str) -> Result<R>
 
pub fn get_var<R: FromLua<'lua>>(&self, name: &str) -> Result<R>
Returns data stored in the variable name.
sourcepub fn set_var<A: IntoLua<'lua>>(&self, name: &str, val: A) -> Result<()>
 
pub fn set_var<A: IntoLua<'lua>>(&self, name: &str, val: A) -> Result<()>
Store variable name in an HAProxy converting the type.
sourcepub fn set_loglevel(&self, level: LogLevel) -> Result<()>
 
pub fn set_loglevel(&self, level: LogLevel) -> Result<()>
Changes the log level of the current request.
The level must be an integer between 0 and 7.
Trait Implementations§
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§
source§impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
 
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
 
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<'lua, T> FromLuaMulti<'lua> for Twhere
    T: FromLua<'lua>,
 
impl<'lua, T> FromLuaMulti<'lua> for Twhere T: FromLua<'lua>,
source§fn from_lua_multi(values: MultiValue<'lua>, lua: &'lua Lua) -> Result<T, Error>
 
fn from_lua_multi(values: MultiValue<'lua>, lua: &'lua Lua) -> Result<T, Error>
Performs the conversion. Read more