pub struct AsyncClient<R: AsyncBufRead + Unpin, W: AsyncWrite + Unpin> { /* private fields */ }
Expand description

SSIP client on generic async stream

There are two ways to send requests and receive responses:

Implementations§

source§

impl<R: AsyncBufRead + Unpin, W: AsyncWrite + Unpin> AsyncClient<R, W>

source

pub async fn send_lines(&mut self, lines: &[String]) -> ClientResult<&mut Self>

Send lines of text (terminated by a single dot).

source

pub async fn receive(&mut self) -> ClientResult<Response>

Receive one response.

source

pub async fn send(&mut self, request: Request) -> ClientResult<&mut Self>

Send a request

source

pub async fn set_client_name( &mut self, client_name: ClientName ) -> ClientResult<&mut Self>

source

pub async fn speak(&mut self) -> ClientResult<&mut Self>

Initiate communitation to send text to speak

source

pub async fn speak_char(&mut self, ch: char) -> ClientResult<&mut Self>

Speak a char

source

pub async fn speak_key(&mut self, key_name: KeyName) -> ClientResult<&mut Self>

Speak a symbolic key name

source

pub async fn stop(&mut self, scope: MessageScope) -> ClientResult<&mut Self>

Stop current message

source

pub async fn cancel(&mut self, scope: MessageScope) -> ClientResult<&mut Self>

Cancel current message

source

pub async fn pause(&mut self, scope: MessageScope) -> ClientResult<&mut Self>

Pause current message

source

pub async fn resume(&mut self, scope: MessageScope) -> ClientResult<&mut Self>

Resume current message

source

pub async fn set_priority(&mut self, prio: Priority) -> ClientResult<&mut Self>

Set message priority

source

pub async fn set_debug(&mut self, value: bool) -> ClientResult<&mut Self>

Set debug mode. Return the log location

source

pub async fn set_output_module( &mut self, scope: ClientScope, value: &str ) -> ClientResult<&mut Self>

Set output module

source

pub async fn get_output_module(&mut self) -> ClientResult<&mut Self>

Get the current output module

source

pub async fn list_output_modules(&mut self) -> ClientResult<&mut Self>

List the available output modules

source

pub async fn set_language( &mut self, scope: ClientScope, value: &str ) -> ClientResult<&mut Self>

Set language code

source

pub async fn get_language(&mut self) -> ClientResult<&mut Self>

Get the current language

source

pub async fn set_ssml_mode(&mut self, mode: bool) -> ClientResult<&mut Self>

Set SSML mode (Speech Synthesis Markup Language)

source

pub async fn set_punctuation_mode( &mut self, scope: ClientScope, mode: PunctuationMode ) -> ClientResult<&mut Self>

Set punctuation mode

source

pub async fn set_spelling( &mut self, scope: ClientScope, value: bool ) -> ClientResult<&mut Self>

Set spelling on or off

source

pub async fn set_capital_letter_recogn( &mut self, scope: ClientScope, mode: CapitalLettersRecognitionMode ) -> ClientResult<&mut Self>

Set capital letters recognition mode

source

pub async fn set_voice_type( &mut self, scope: ClientScope, value: &str ) -> ClientResult<&mut Self>

Set the voice type (MALE1, FEMALE1, …)

source

pub async fn get_voice_type(&mut self) -> ClientResult<&mut Self>

Get the current pre-defined voice

source

pub async fn list_voice_types(&mut self) -> ClientResult<&mut Self>

List the available symbolic voice names

source

pub async fn set_synthesis_voice( &mut self, scope: ClientScope, value: &str ) -> ClientResult<&mut Self>

Set the voice

source

pub async fn list_synthesis_voices(&mut self) -> ClientResult<&mut Self>

Lists the available voices for the current synthesizer

source

pub async fn set_rate( &mut self, scope: ClientScope, value: i8 ) -> ClientResult<&mut Self>

Set the rate of speech. n is an integer value within the range from -100 to 100, lower values meaning slower speech.

source

pub async fn get_rate(&mut self) -> ClientResult<&mut Self>

Get the current rate of speech.

source

pub async fn set_pitch( &mut self, scope: ClientScope, value: i8 ) -> ClientResult<&mut Self>

Set the pitch of speech. n is an integer value within the range from -100 to 100.

source

pub async fn get_pitch(&mut self) -> ClientResult<&mut Self>

Get the current pitch value.

source

pub async fn set_volume( &mut self, scope: ClientScope, value: i8 ) -> ClientResult<&mut Self>

Set the volume of speech. n is an integer value within the range from -100 to 100.

source

pub async fn get_volume(&mut self) -> ClientResult<&mut Self>

Get the current volume.

source

pub async fn set_pause_context( &mut self, scope: ClientScope, value: u32 ) -> ClientResult<&mut Self>

Set the number of (more or less) sentences that should be repeated after a previously paused text is resumed.

source

pub async fn set_notification( &mut self, ntype: NotificationType, value: bool ) -> ClientResult<&mut Self>

Enable notification events

source

pub async fn block_begin(&mut self) -> ClientResult<&mut Self>

Open a block

source

pub async fn block_end(&mut self) -> ClientResult<&mut Self>

End a block

source

pub async fn set_history( &mut self, scope: ClientScope, value: bool ) -> ClientResult<&mut Self>

Enable or disable history of received messages.

source

pub async fn history_get_clients(&mut self) -> ClientResult<&mut Self>

Get clients in history.

source

pub async fn history_get_client_id(&mut self) -> ClientResult<&mut Self>

Get client id in the history.

source

pub async fn history_get_last(&mut self) -> ClientResult<&mut Self>

Get last message said.

source

pub async fn history_get_client_messages( &mut self, scope: ClientScope, start: u32, number: u32 ) -> ClientResult<&mut Self>

Get a range of client messages.

source

pub async fn history_get_last_message_id(&mut self) -> ClientResult<&mut Self>

Get the id of the last message sent by the client.

source

pub async fn history_get_message( &mut self, msg_id: MessageId ) -> ClientResult<&mut Self>

Return the text of an history message.

source

pub async fn history_get_cursor(&mut self) -> ClientResult<&mut Self>

Get the id of the message the history cursor is pointing to.

source

pub async fn history_set_cursor( &mut self, scope: ClientScope, pos: HistoryPosition ) -> ClientResult<&mut Self>

Set the history cursor position.

source

pub async fn history_move_cursor( &mut self, direction: CursorDirection ) -> ClientResult<&mut Self>

Move the cursor position backward or forward.

source

pub async fn history_speak( &mut self, msg_id: MessageId ) -> ClientResult<&mut Self>

Speak the message from history.

source

pub async fn history_sort( &mut self, direction: SortDirection, key: SortKey ) -> ClientResult<&mut Self>

Sort messages in history.

source

pub async fn history_set_short_message_length( &mut self, length: u32 ) -> ClientResult<&mut Self>

Set the maximum length of short versions of history messages.

source

pub async fn history_set_ordering( &mut self, ordering: Vec<Ordering> ) -> ClientResult<&mut Self>

Set the ordering of the message types, from the minimum to the maximum.

Search in message history.

source

pub async fn quit(&mut self) -> ClientResult<&mut Self>

Close the connection

source

pub async fn check_status( &mut self, expected_code: ReturnCode ) -> ClientResult<&mut Self>

Check status of answer, discard lines.

source

pub async fn receive_lines( &mut self, expected_code: ReturnCode ) -> ClientResult<Vec<String>>

Receive lines

source

pub async fn receive_string( &mut self, expected_code: ReturnCode ) -> ClientResult<String>

Receive a single string

source

pub async fn receive_i8(&mut self) -> ClientResult<u8>

Receive signed 8-bit integer

source

pub async fn receive_u8(&mut self) -> ClientResult<u8>

Receive unsigned 8-bit integer

source

pub async fn receive_cursor_pos(&mut self) -> ClientResult<u16>

Receive cursor pos

source

pub async fn receive_message_id(&mut self) -> ClientResult<MessageId>

Receive message id

source

pub async fn receive_client_id(&mut self) -> ClientResult<ClientId>

Receive client id

source

pub async fn receive_synthesis_voices( &mut self ) -> ClientResult<Vec<SynthesisVoice>>

Receive a list of synthesis voices

source

pub async fn receive_event(&mut self) -> ClientResult<Event>

Receive a notification

source

pub async fn receive_history_clients( &mut self ) -> ClientResult<Vec<HistoryClientStatus>>

Receive a list of client status from history.

source

pub async fn check_client_name_set(&mut self) -> ClientResult<&mut Self>

Check the result of set_client_name.

source

pub async fn check_receiving_data(&mut self) -> ClientResult<&mut Self>

Check if server accept data.

Auto Trait Implementations§

§

impl<R, W> RefUnwindSafe for AsyncClient<R, W>where R: RefUnwindSafe, W: RefUnwindSafe,

§

impl<R, W> Send for AsyncClient<R, W>where R: Send, W: Send,

§

impl<R, W> Sync for AsyncClient<R, W>where R: Sync, W: Sync,

§

impl<R, W> Unpin for AsyncClient<R, W>

§

impl<R, W> UnwindSafe for AsyncClient<R, W>where R: UnwindSafe, W: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.