Struct QueryClient

Source
pub struct QueryClient { /* private fields */ }
Expand description

Ts3 Query client with active connection

Implementations§

Source§

impl QueryClient

Source

pub fn new<A: ToSocketAddrs>(addr: A) -> Result<Self, Ts3Error>

Create new query connection

Source

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

Source

pub fn limit_lines(&mut self, limit: usize)

Set new maximum amount of lines to read per response, until DoS protection triggers.

Source

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.

Source

pub fn rename<T: AsRef<str>>(&mut self, name: T) -> Result<(), Ts3Error>

Rename this client, performs clientupdate client_nickname escaping the name

Source

pub fn rename_channel<T: AsRef<str>>( &mut self, channel: ChannelId, name: T, ) -> Result<(), Ts3Error>

Update channel name, performs channeledit channel_name

Source

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.

Source

pub fn poke_client<T: AsRef<str>>( &mut self, client: ClientId, msg: T, ) -> Result<(), Ts3Error>

Poke a client.

Performs clientpoke

Source

pub fn send_message<T: AsRef<str>>( &mut self, target: MessageTarget, msg: T, ) -> Result<(), Ts3Error>

Send chat message

Source

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.

Source

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.

Source

pub fn logout(&mut self) -> Result<(), Ts3Error>

Logout

Source

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

Source

pub fn select_server_by_port(&mut self, port: u16) -> Result<(), Ts3Error>

Select server to perform commands on, by port

Performs use port

Source

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

Source

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

Source

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

Source

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

Source

pub fn ping(&mut self) -> Result<(), Ts3Error>

Low-cost connection check

Performs whoami command without parsing

Source

pub fn select_server_by_id(&mut self, sid: ServerId) -> Result<(), Ts3Error>

Select server to perform commands on, by server id.

Performs use sid

Source

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.

Source

pub fn server_group_add_clients( &mut self, group: ServerGroupID, cldbid: &[usize], ) -> Result<(), Ts3Error>

Performs servergroupaddclient
Ads all specified cldbid clients to group.

Source

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

Source

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

Source

pub fn channels(&mut self) -> Result<Vec<Channel>, Ts3Error>

Returns a list of channels. Values are unescaped where applicable.

Performs channellist

Source

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

Source

pub fn delete_channel( &mut self, id: ChannelId, force: bool, ) -> Result<(), Ts3Error>

Deletes a channel

Performs channeldelete cid={} force={}

Source

pub fn create_channel( &mut self, channel: &ChannelEdit, ) -> Result<ChannelId, Ts3Error>

Creates a channel Performs channelcreate

Source

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

Source

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

Trait Implementations§

Source§

impl Drop for QueryClient

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.