Struct ssip_client::client::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.

Trait Implementations§

source§

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

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

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

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

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>,

§

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>,

§

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.