pub struct QueryClient { /* private fields */ }
Expand description
Ts3 Query client with active connection
Implementations§
Source§impl QueryClient
impl QueryClient
Sourcepub fn new<A: ToSocketAddrs>(addr: A) -> Result<Self, Ts3Error>
pub fn new<A: ToSocketAddrs>(addr: A) -> Result<Self, Ts3Error>
Create new query connection
Sourcepub fn with_timeout<A: ToSocketAddrs>(
addr: A,
t_connect: Option<Duration>,
timeout: Option<Duration>,
) -> Result<Self, Ts3Error>
pub fn with_timeout<A: ToSocketAddrs>( addr: A, t_connect: Option<Duration>, timeout: Option<Duration>, ) -> Result<Self, Ts3Error>
Create new query connection with timeouts
t_connect
is used for connection, timeout
for read/write operations
Sourcepub fn limit_lines(&mut self, limit: usize)
pub fn limit_lines(&mut self, limit: usize)
Set new maximum amount of lines to read per response, until DoS protection triggers.
Sourcepub fn limit_line_bytes(&mut self, limit: u64)
pub fn limit_line_bytes(&mut self, limit: u64)
Set new maximum amount of bytes per line to read until DoS protection triggers.
You may need to increase this for backup/restore of instances.
Sourcepub fn rename<T: AsRef<str>>(&mut self, name: T) -> Result<(), Ts3Error>
pub fn rename<T: AsRef<str>>(&mut self, name: T) -> Result<(), Ts3Error>
Rename this client, performs clientupdate client_nickname
escaping the name
Sourcepub fn rename_channel<T: AsRef<str>>(
&mut self,
channel: ChannelId,
name: T,
) -> Result<(), Ts3Error>
pub fn rename_channel<T: AsRef<str>>( &mut self, channel: ChannelId, name: T, ) -> Result<(), Ts3Error>
Update channel name, performs channeledit channel_name
Sourcepub fn update_description<T: AsRef<str>>(
&mut self,
descr: T,
target: Option<ClientId>,
) -> Result<(), Ts3Error>
pub fn update_description<T: AsRef<str>>( &mut self, descr: T, target: Option<ClientId>, ) -> Result<(), Ts3Error>
Update client description. If target is none updates this clients description.
Performs clientupdate CLIENT_DESCRIPTION
or clientedit clid=
with CLIENT_DESCRIPTION
if target is set.
Sourcepub fn poke_client<T: AsRef<str>>(
&mut self,
client: ClientId,
msg: T,
) -> Result<(), Ts3Error>
pub fn poke_client<T: AsRef<str>>( &mut self, client: ClientId, msg: T, ) -> Result<(), Ts3Error>
Poke a client.
Performs clientpoke
Sourcepub fn send_message<T: AsRef<str>>(
&mut self,
target: MessageTarget,
msg: T,
) -> Result<(), Ts3Error>
pub fn send_message<T: AsRef<str>>( &mut self, target: MessageTarget, msg: T, ) -> Result<(), Ts3Error>
Send chat message
Sourcepub fn raw_command<T: AsRef<str>>(
&mut self,
command: T,
) -> Result<Vec<String>, Ts3Error>
pub fn raw_command<T: AsRef<str>>( &mut self, command: T, ) -> Result<Vec<String>, Ts3Error>
Perform a raw command, returns its response as raw value. (No unescaping is performed.)
You need to escape the command properly.
Sourcepub fn whoami(
&mut self,
unescape: bool,
) -> Result<HashMap<String, Option<String>>, Ts3Error>
pub fn whoami( &mut self, unescape: bool, ) -> Result<HashMap<String, Option<String>>, Ts3Error>
Performs whoami
Returns a hashmap of entries. Values are unescaped if set.
Sourcepub fn login<T: AsRef<str>, S: AsRef<str>>(
&mut self,
user: T,
password: S,
) -> Result<(), Ts3Error>
pub fn login<T: AsRef<str>, S: AsRef<str>>( &mut self, user: T, password: S, ) -> Result<(), Ts3Error>
Login with provided data
On drop queryclient issues a logout
Sourcepub fn select_server_by_port(&mut self, port: u16) -> Result<(), Ts3Error>
pub fn select_server_by_port(&mut self, port: u16) -> Result<(), Ts3Error>
Select server to perform commands on, by port
Performs use port
Sourcepub fn move_client(
&mut self,
client: ClientId,
channel: ChannelId,
password: Option<&str>,
) -> Result<(), Ts3Error>
pub fn move_client( &mut self, client: ClientId, channel: ChannelId, password: Option<&str>, ) -> Result<(), Ts3Error>
Move client to channel with optional channel password
Performs clientmove
Sourcepub fn kick_client(
&mut self,
client: ClientId,
server: bool,
message: Option<&str>,
) -> Result<(), Ts3Error>
pub fn kick_client( &mut self, client: ClientId, server: bool, message: Option<&str>, ) -> Result<(), Ts3Error>
Kick client with specified message from channel/server. Message can’t be longer than 40 characters.
Performs clientkick
Sourcepub fn create_dir<T: AsRef<str>>(
&mut self,
channel: ChannelId,
path: T,
) -> Result<(), Ts3Error>
pub fn create_dir<T: AsRef<str>>( &mut self, channel: ChannelId, path: T, ) -> Result<(), Ts3Error>
Create file directory in channel, has to be a valid path starting with /
Performs ftcreatedir
Sourcepub fn delete_file<T: AsRef<str>>(
&mut self,
channel: ChannelId,
path: T,
) -> Result<(), Ts3Error>
pub fn delete_file<T: AsRef<str>>( &mut self, channel: ChannelId, path: T, ) -> Result<(), Ts3Error>
Delete File/Folder in channel, acts recursive on folders
Example: /My Directory
deletes everything inside that directory.
Performs ftdeletefile
Sourcepub fn ping(&mut self) -> Result<(), Ts3Error>
pub fn ping(&mut self) -> Result<(), Ts3Error>
Low-cost connection check
Performs whoami
command without parsing
Sourcepub fn select_server_by_id(&mut self, sid: ServerId) -> Result<(), Ts3Error>
pub fn select_server_by_id(&mut self, sid: ServerId) -> Result<(), Ts3Error>
Select server to perform commands on, by server id.
Performs use sid
Sourcepub fn server_group_del_clients(
&mut self,
group: ServerGroupID,
cldbid: &[usize],
) -> Result<(), Ts3Error>
pub fn server_group_del_clients( &mut self, group: ServerGroupID, cldbid: &[usize], ) -> Result<(), Ts3Error>
Performs servergroupdelclient
Removes all client-db-ids in cldbid
from the specified group
id.
Sourcepub fn server_group_add_clients(
&mut self,
group: ServerGroupID,
cldbid: &[usize],
) -> Result<(), Ts3Error>
pub fn server_group_add_clients( &mut self, group: ServerGroupID, cldbid: &[usize], ) -> Result<(), Ts3Error>
Performs servergroupaddclient
Ads all specified cldbid
clients to group
.
Sourcepub fn online_clients_full(&mut self) -> Result<Vec<OnlineClientFull>, Ts3Error>
pub fn online_clients_full(&mut self) -> Result<Vec<OnlineClientFull>, Ts3Error>
Returns a list of online clients with full infos. Visiblity depends on current permissions. Values are unescaped where applicable.
Performs clientlist -uid -away -voice -times -groups -info -country -ip -badges
Sourcepub fn online_clients(&mut self) -> Result<Vec<OnlineClient>, Ts3Error>
pub fn online_clients(&mut self) -> Result<Vec<OnlineClient>, Ts3Error>
Returns a list of online clients. Visiblity depends on current permissions. Values are unescaped where applicable.
Performs clientlist
Sourcepub fn channels(&mut self) -> Result<Vec<Channel>, Ts3Error>
pub fn channels(&mut self) -> Result<Vec<Channel>, Ts3Error>
Returns a list of channels. Values are unescaped where applicable.
Performs channellist
Sourcepub fn channels_full(&mut self) -> Result<Vec<ChannelFull>, Ts3Error>
pub fn channels_full(&mut self) -> Result<Vec<ChannelFull>, Ts3Error>
Returns a list of channels with full infos. Values are unescaped where applicable.
Performs channellist -topic -flags -voice -limits -icon -secondsempty
Sourcepub fn delete_channel(
&mut self,
id: ChannelId,
force: bool,
) -> Result<(), Ts3Error>
pub fn delete_channel( &mut self, id: ChannelId, force: bool, ) -> Result<(), Ts3Error>
Deletes a channel
Performs channeldelete cid={} force={}
Sourcepub fn create_channel(
&mut self,
channel: &ChannelEdit,
) -> Result<ChannelId, Ts3Error>
pub fn create_channel( &mut self, channel: &ChannelEdit, ) -> Result<ChannelId, Ts3Error>
Creates a channel
Performs channelcreate
Sourcepub fn server_groups(&mut self) -> Result<Vec<ServerGroup>, Ts3Error>
pub fn server_groups(&mut self) -> Result<Vec<ServerGroup>, Ts3Error>
Returns a list of server groups. May contain templates and query groups if permitted. Values are unescaped where applicable.
Performs servergrouplist
Sourcepub fn servergroup_client_cldbids(
&mut self,
group: ServerGroupID,
) -> Result<Vec<usize>, Ts3Error>
pub fn servergroup_client_cldbids( &mut self, group: ServerGroupID, ) -> Result<Vec<usize>, Ts3Error>
Get a list of client-DB-IDs for a given server group ID
See servergroupclientlist