hexchat_unsafe_plugin/
eat.rs

1// This file is part of Hexchat Plugin API Bindings for Rust
2// Copyright (C) 2018, 2021 Soni L.
3//
4// This program is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as
6// published by the Free Software Foundation, either version 3 of the
7// License, or (at your option) any later version.
8//
9// This program is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with this program.  If not, see <https://www.gnu.org/licenses/>.
16
17/// A status indicator for event callbacks. Indicates whether to continue processing, eat hexchat,
18/// eat plugin, or eat all.
19///
20/// Returned by most hooks.
21#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
22pub struct Eat {
23    pub(crate) do_eat: i32,
24}
25
26/// Equivalent to HEXCHAT_EAT_NONE.
27pub const EAT_NONE: Eat = Eat { do_eat: 0 };
28/// Equivalent to HEXCHAT_EAT_HEXCHAT.
29pub const EAT_HEXCHAT: Eat = Eat { do_eat: 1 };
30/// Equivalent to HEXCHAT_EAT_PLUGIN.
31pub const EAT_PLUGIN: Eat = Eat { do_eat: 2 };
32/// Equivalent to HEXCHAT_EAT_ALL.
33pub const EAT_ALL: Eat = Eat { do_eat: 1 | 2 };
34