40 lines
No EOL
832 B
Rust
40 lines
No EOL
832 B
Rust
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")
|
|
}
|
|
} |