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
sourceimpl<'lua> Txn<'lua>
impl<'lua> Txn<'lua>
sourcepub fn log<S>(&self, level: LogLevel, msg: &S) -> Result<()> where
S: AsRef<str> + ?Sized,
pub fn log<S>(&self, level: LogLevel, msg: &S) -> Result<()> where
S: AsRef<str> + ?Sized,
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: ToLua<'lua>>(&self, val: A) -> Result<()>
pub fn set_priv<A: ToLua<'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: ToLua<'lua>>(&self, name: &str, val: A) -> Result<()>
pub fn set_var<A: ToLua<'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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<'lua, T> FromLuaMulti<'lua> for T where
T: FromLua<'lua>,
impl<'lua, T> FromLuaMulti<'lua> for T where
T: FromLua<'lua>,
sourcefn 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