Struct ts3::client::Client[][src]

pub struct Client { /* fields omitted */ }
Expand description

A Client used to send commands to the serverquery interface.

Implementations

impl Client[src]

pub async fn new<A: ToSocketAddrs>(addr: A) -> Result<Client>[src]

Create a new connection

pub fn set_event_handler<H: EventHandler + 'static>(&self, handler: H)[src]

pub async fn send<T: Decode<T>>(&self, cmd: String) -> Result<T>[src]

Send a raw command directly to the server. The response will be directly decoded into the type T. To get a HashMap like response, use the RawResp struct.

impl Client[src]

pub async fn apikeyadd(
    &self,
    scope: APIKeyScope,
    lifetime: Option<u64>,
    cldbid: Option<u64>
) -> Result<APIKey>
[src]

Creates a new apikey using the specified scope, for the invoking user. The default lifetime of a token is 14 days, a zero lifetime means no expiration. It is possible to create apikeys for other users using b_virtualserver_apikey_manage.

pub async fn apikeydel(&self, id: u64) -> Result<()>[src]

Delete an apikey. Any apikey owned by the current user can always be deleted. Deleting apikeys from another user requires b_virtualserver_apikey_manage.

pub async fn apikeylist(
    &self,
    cldbid: Option<(u64, bool)>,
    start: Option<u64>,
    duration: Option<u64>,
    count: bool
) -> Result<Vec<APIKey>>
[src]

Lists all apikeys owned by the user, or of all users using cldbid=(0, true). Usage of cldbid=… requires b_virtualserver_apikey_manage.

pub async fn gm(&self, msg: &str) -> Result<()>[src]

Sends a text message to all clients on all virtual servers in the TeamSpeak 3 Server instance.

pub async fn login(&self, username: &str, password: &str) -> Result<()>[src]

Authenticate with the given data.

pub async fn logout(&self) -> Result<()>[src]

Deselects the active virtual server and logs out from the server instance.

pub async fn quit(&self) -> Result<()>[src]

Send a quit command, disconnecting the client and closing the TCP connection

pub async fn sendtextmessage(
    &self,
    target: TextMessageTarget,
    msg: &str
) -> Result<()>
[src]

pub async fn servergroupaddclient(
    &self,
    sgid: usize,
    cldbid: usize
) -> Result<()>
[src]

Adds one or more clients to the server group specified with sgid. Please note that a client cannot be added to default groups or template groups.

pub async fn servergroupdelclient(
    &self,
    sgid: usize,
    cldbid: usize
) -> Result<()>
[src]

Removes one or more clients specified with cldbid from the server group specified with sgid.

pub async fn servernotifyregister(
    &self,
    event: ServerNotifyRegister
) -> Result<()>
[src]

Registers for a specified category of events on a virtual server to receive notification messages. Depending on the notifications you’ve registered for, the server will send you a message on every event in the view of your ServerQuery client (e.g. clients joining your channel, incoming text messages, server configuration changes, etc). The event source is declared by the event parameter while id can be used to limit the notifications to a specific channel.

pub async fn serverstart(&self, sid: u64) -> Result<()>[src]

Starts the virtual server specified with sid. Depending on your permissions, you’re able to start either your own virtual server only or all virtual servers in the server instance.

pub async fn serverstop(&self, sid: u64) -> Result<()>[src]

Stops the virtual server specified with sid. Depending on your permissions, you’re able to stop either your own virtual server only or all virtual servers in the server instance. The reasonmsg parameter specifies a text message that is sent to the clients before the client disconnects.

pub async fn use_sid(&self, sid: usize) -> Result<()>[src]

Switch to the virtualserver (voice) with the given server id

pub async fn use_port(&self, port: u16) -> Result<()>[src]

Like use_sid but instead use_port uses the voice port to connect to the virtualserver

pub async fn version(&self) -> Result<Version>[src]

Returns information about the server version

pub async fn whoami(&self) -> Result<RawResp>[src]

Returns information about the query client connected

Trait Implementations

impl Clone for Client[src]

fn clone(&self) -> Client[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl !RefUnwindSafe for Client

impl Send for Client

impl Sync for Client

impl Unpin for Client

impl !UnwindSafe for Client

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.