Struct Client

Source
pub struct Client<S: Read + Write + Source> { /* private fields */ }
Expand description

SSIP client on generic stream

There are two ways to send requests and receive responses:

Implementations§

Source§

impl<S: Read + Write + Source> Client<S>

Source

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

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

Source

pub fn send_line(&mut self, line: &str) -> ClientResult<&mut Self>

Send one line of text (terminated by a single dot).

Source

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

Send a request

Source

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

Set the client name. It must be the first call on startup.

Source

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

Initiate communitation to send text to speak

Source

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

Speak a char

Source

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

Speak a symbolic key name

Source

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

Stop current message

Source

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

Cancel current message

Source

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

Pause current message

Source

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

Resume current message

Source

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

Set message priority

Source

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

Set debug mode. Return the log location

Source

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

Set output module

Source

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

Get the current output module

Source

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

List the available output modules

Source

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

Set language code

Source

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

Get the current language

Source

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

Set SSML mode (Speech Synthesis Markup Language)

Source

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

Set punctuation mode

Source

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

Set spelling on or off

Source

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

Set capital letters recognition mode

Source

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

Set the voice type (MALE1, FEMALE1, …)

Source

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

Get the current pre-defined voice

Source

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

List the available symbolic voice names

Source

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

Set the voice

Source

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

Lists the available voices for the current synthesizer

Source

pub 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 fn get_rate(&mut self) -> ClientResult<&mut Self>

Get the current rate of speech.

Source

pub 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 fn get_pitch(&mut self) -> ClientResult<&mut Self>

Get the current pitch value.

Source

pub 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 fn get_volume(&mut self) -> ClientResult<&mut Self>

Get the current volume.

Source

pub 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 fn set_notification( &mut self, ntype: NotificationType, value: bool, ) -> ClientResult<&mut Self>

Enable notification events

Source

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

Open a block

Source

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

End a block

Source

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

Enable or disable history of received messages.

Source

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

Get clients in history.

Source

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

Get client id in the history.

Source

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

Get last message said.

Source

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

Get a range of client messages.

Source

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

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

Source

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

Return the text of an history message.

Source

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

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

Source

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

Set the history cursor position.

Source

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

Move the cursor position backward or forward.

Source

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

Speak the message from history.

Source

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

Sort messages in history.

Source

pub 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 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 fn quit(&mut self) -> ClientResult<&mut Self>

Close the connection

Source

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

Receive one response.

Source

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

Check status of answer, discard lines.

Source

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

Receive lines

Source

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

Receive a single string

Source

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

Receive signed 8-bit integer

Source

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

Receive unsigned 8-bit integer

Source

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

Receive cursor pos

Source

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

Receive message id

Source

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

Receive client id

Source

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

Receive a list of synthesis voices

Source

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

Receive a notification

Source

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

Receive a list of client status from history.

Source

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

Check the result of set_client_name.

Source

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

Check if server accept data.

Auto Trait Implementations§

§

impl<S> Freeze for Client<S>
where S: Freeze,

§

impl<S> RefUnwindSafe for Client<S>
where S: RefUnwindSafe,

§

impl<S> Send for Client<S>
where S: Send,

§

impl<S> Sync for Client<S>
where S: Sync,

§

impl<S> Unpin for Client<S>
where S: Unpin,

§

impl<S> UnwindSafe for Client<S>
where S: UnwindSafe,

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.