mc-rcon/src/command/banlist.rs
2026-08-01 14:24:17 +02:00

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")
}
}