haproxy_api/
stick_table.rs1use std::ops::Deref;
2
3use mlua::{FromLua, Lua, ObjectLike, Result, Table, Value};
4
5#[derive(Clone)]
7pub struct StickTable(Table);
8
9impl StickTable {
10 #[inline]
12 pub fn info(&self) -> Result<Table> {
13 self.call_method("info", ())
14 }
15
16 #[inline]
18 pub fn lookup(&self, key: &str) -> Result<Table> {
19 self.call_method("lookup", key)
20 }
21
22 #[inline]
28 pub fn dump(&self, filter: Option<&str>) -> Result<Table> {
29 self.call_method("dump", filter)
30 }
31}
32
33impl FromLua for StickTable {
34 #[inline]
35 fn from_lua(value: Value, lua: &Lua) -> Result<Self> {
36 let class = Table::from_lua(value, lua)?;
37 Ok(StickTable(class))
38 }
39}
40
41impl Deref for StickTable {
42 type Target = Table;
43
44 #[inline]
45 fn deref(&self) -> &Self::Target {
46 &self.0
47 }
48}