add banlist
This commit is contained in:
parent
9ff3aad199
commit
f835beef10
2 changed files with 45 additions and 0 deletions
40
src/command/banlist.rs
Normal file
40
src/command/banlist.rs
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
use std::marker::PhantomData;
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct BanlistCommand<State> {
|
||||
state: PhantomData<State>
|
||||
}
|
||||
|
||||
pub struct NoFilter;
|
||||
pub struct Ips;
|
||||
pub struct Players;
|
||||
|
||||
impl BanlistCommand<NoFilter> {
|
||||
pub(crate) fn new() -> Self {
|
||||
Self { state: PhantomData }
|
||||
}
|
||||
|
||||
pub fn players(self) -> BanlistCommand<Players> {
|
||||
BanlistCommand { state: PhantomData }
|
||||
}
|
||||
|
||||
pub fn ips(self) -> BanlistCommand<Ips> {
|
||||
BanlistCommand { state: PhantomData }
|
||||
}
|
||||
|
||||
pub fn build(self) -> super::Command {
|
||||
super::Command::raw("banlist")
|
||||
}
|
||||
}
|
||||
|
||||
impl BanlistCommand<Players> {
|
||||
pub fn build(self) -> super::Command {
|
||||
super::Command::raw("banlist players")
|
||||
}
|
||||
}
|
||||
|
||||
impl BanlistCommand<Ips> {
|
||||
pub fn build(self) -> super::Command {
|
||||
super::Command::raw("banlist ips")
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue