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:
- Either with the generic
Client::send
andClient::receive
- Or with the specific methods such as
Client::set_rate
, …,Client::get_rate
, …
Implementations§
Source§impl<S: Read + Write + Source> Client<S>
impl<S: Read + Write + Source> Client<S>
Sourcepub fn send_lines(&mut self, lines: &[String]) -> ClientResult<&mut Self>
pub fn send_lines(&mut self, lines: &[String]) -> ClientResult<&mut Self>
Send lines of text (terminated by a single dot).
Sourcepub fn send_line(&mut self, line: &str) -> ClientResult<&mut Self>
pub fn send_line(&mut self, line: &str) -> ClientResult<&mut Self>
Send one line of text (terminated by a single dot).
Sourcepub fn send(&mut self, request: Request) -> ClientResult<&mut Self>
pub fn send(&mut self, request: Request) -> ClientResult<&mut Self>
Send a request
Sourcepub fn set_client_name(
&mut self,
client_name: ClientName,
) -> ClientResult<&mut Self>
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.
Sourcepub fn speak(&mut self) -> ClientResult<&mut Self>
pub fn speak(&mut self) -> ClientResult<&mut Self>
Initiate communitation to send text to speak
Sourcepub fn speak_char(&mut self, ch: char) -> ClientResult<&mut Self>
pub fn speak_char(&mut self, ch: char) -> ClientResult<&mut Self>
Speak a char
Sourcepub fn speak_key(&mut self, key_name: KeyName) -> ClientResult<&mut Self>
pub fn speak_key(&mut self, key_name: KeyName) -> ClientResult<&mut Self>
Speak a symbolic key name
Sourcepub fn stop(&mut self, scope: MessageScope) -> ClientResult<&mut Self>
pub fn stop(&mut self, scope: MessageScope) -> ClientResult<&mut Self>
Stop current message
Sourcepub fn cancel(&mut self, scope: MessageScope) -> ClientResult<&mut Self>
pub fn cancel(&mut self, scope: MessageScope) -> ClientResult<&mut Self>
Cancel current message
Sourcepub fn pause(&mut self, scope: MessageScope) -> ClientResult<&mut Self>
pub fn pause(&mut self, scope: MessageScope) -> ClientResult<&mut Self>
Pause current message
Sourcepub fn resume(&mut self, scope: MessageScope) -> ClientResult<&mut Self>
pub fn resume(&mut self, scope: MessageScope) -> ClientResult<&mut Self>
Resume current message
Sourcepub fn set_priority(&mut self, prio: Priority) -> ClientResult<&mut Self>
pub fn set_priority(&mut self, prio: Priority) -> ClientResult<&mut Self>
Set message priority
Sourcepub fn set_debug(&mut self, value: bool) -> ClientResult<&mut Self>
pub fn set_debug(&mut self, value: bool) -> ClientResult<&mut Self>
Set debug mode. Return the log location
Sourcepub fn set_output_module(
&mut self,
scope: ClientScope,
value: &str,
) -> ClientResult<&mut Self>
pub fn set_output_module( &mut self, scope: ClientScope, value: &str, ) -> ClientResult<&mut Self>
Set output module
Sourcepub fn get_output_module(&mut self) -> ClientResult<&mut Self>
pub fn get_output_module(&mut self) -> ClientResult<&mut Self>
Get the current output module
Sourcepub fn list_output_modules(&mut self) -> ClientResult<&mut Self>
pub fn list_output_modules(&mut self) -> ClientResult<&mut Self>
List the available output modules
Sourcepub fn set_language(
&mut self,
scope: ClientScope,
value: &str,
) -> ClientResult<&mut Self>
pub fn set_language( &mut self, scope: ClientScope, value: &str, ) -> ClientResult<&mut Self>
Set language code
Sourcepub fn get_language(&mut self) -> ClientResult<&mut Self>
pub fn get_language(&mut self) -> ClientResult<&mut Self>
Get the current language
Sourcepub fn set_ssml_mode(&mut self, mode: bool) -> ClientResult<&mut Self>
pub fn set_ssml_mode(&mut self, mode: bool) -> ClientResult<&mut Self>
Set SSML mode (Speech Synthesis Markup Language)
Sourcepub fn set_punctuation_mode(
&mut self,
scope: ClientScope,
mode: PunctuationMode,
) -> ClientResult<&mut Self>
pub fn set_punctuation_mode( &mut self, scope: ClientScope, mode: PunctuationMode, ) -> ClientResult<&mut Self>
Set punctuation mode
Sourcepub fn set_spelling(
&mut self,
scope: ClientScope,
value: bool,
) -> ClientResult<&mut Self>
pub fn set_spelling( &mut self, scope: ClientScope, value: bool, ) -> ClientResult<&mut Self>
Set spelling on or off
Sourcepub fn set_capital_letter_recogn(
&mut self,
scope: ClientScope,
mode: CapitalLettersRecognitionMode,
) -> ClientResult<&mut Self>
pub fn set_capital_letter_recogn( &mut self, scope: ClientScope, mode: CapitalLettersRecognitionMode, ) -> ClientResult<&mut Self>
Set capital letters recognition mode
Sourcepub fn set_voice_type(
&mut self,
scope: ClientScope,
value: &str,
) -> ClientResult<&mut Self>
pub fn set_voice_type( &mut self, scope: ClientScope, value: &str, ) -> ClientResult<&mut Self>
Set the voice type (MALE1, FEMALE1, …)
Sourcepub fn get_voice_type(&mut self) -> ClientResult<&mut Self>
pub fn get_voice_type(&mut self) -> ClientResult<&mut Self>
Get the current pre-defined voice
Sourcepub fn list_voice_types(&mut self) -> ClientResult<&mut Self>
pub fn list_voice_types(&mut self) -> ClientResult<&mut Self>
List the available symbolic voice names
Sourcepub fn set_synthesis_voice(
&mut self,
scope: ClientScope,
value: &str,
) -> ClientResult<&mut Self>
pub fn set_synthesis_voice( &mut self, scope: ClientScope, value: &str, ) -> ClientResult<&mut Self>
Set the voice
Sourcepub fn list_synthesis_voices(&mut self) -> ClientResult<&mut Self>
pub fn list_synthesis_voices(&mut self) -> ClientResult<&mut Self>
Lists the available voices for the current synthesizer
Sourcepub fn set_rate(
&mut self,
scope: ClientScope,
value: i8,
) -> ClientResult<&mut Self>
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.
Sourcepub fn get_rate(&mut self) -> ClientResult<&mut Self>
pub fn get_rate(&mut self) -> ClientResult<&mut Self>
Get the current rate of speech.
Sourcepub fn set_pitch(
&mut self,
scope: ClientScope,
value: i8,
) -> ClientResult<&mut Self>
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.
Sourcepub fn get_pitch(&mut self) -> ClientResult<&mut Self>
pub fn get_pitch(&mut self) -> ClientResult<&mut Self>
Get the current pitch value.
Sourcepub fn set_volume(
&mut self,
scope: ClientScope,
value: i8,
) -> ClientResult<&mut Self>
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.
Sourcepub fn get_volume(&mut self) -> ClientResult<&mut Self>
pub fn get_volume(&mut self) -> ClientResult<&mut Self>
Get the current volume.
Sourcepub fn set_pause_context(
&mut self,
scope: ClientScope,
value: u32,
) -> ClientResult<&mut Self>
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.
Sourcepub fn set_notification(
&mut self,
ntype: NotificationType,
value: bool,
) -> ClientResult<&mut Self>
pub fn set_notification( &mut self, ntype: NotificationType, value: bool, ) -> ClientResult<&mut Self>
Enable notification events
Sourcepub fn block_begin(&mut self) -> ClientResult<&mut Self>
pub fn block_begin(&mut self) -> ClientResult<&mut Self>
Open a block
Sourcepub fn block_end(&mut self) -> ClientResult<&mut Self>
pub fn block_end(&mut self) -> ClientResult<&mut Self>
End a block
Sourcepub fn set_history(
&mut self,
scope: ClientScope,
value: bool,
) -> ClientResult<&mut Self>
pub fn set_history( &mut self, scope: ClientScope, value: bool, ) -> ClientResult<&mut Self>
Enable or disable history of received messages.
Sourcepub fn history_get_clients(&mut self) -> ClientResult<&mut Self>
pub fn history_get_clients(&mut self) -> ClientResult<&mut Self>
Get clients in history.
Sourcepub fn history_get_client_id(&mut self) -> ClientResult<&mut Self>
pub fn history_get_client_id(&mut self) -> ClientResult<&mut Self>
Get client id in the history.
Sourcepub fn history_get_last(&mut self) -> ClientResult<&mut Self>
pub fn history_get_last(&mut self) -> ClientResult<&mut Self>
Get last message said.
Sourcepub fn history_get_client_messages(
&mut self,
scope: ClientScope,
start: u32,
number: u32,
) -> ClientResult<&mut Self>
pub fn history_get_client_messages( &mut self, scope: ClientScope, start: u32, number: u32, ) -> ClientResult<&mut Self>
Get a range of client messages.
Sourcepub fn history_get_last_message_id(&mut self) -> ClientResult<&mut Self>
pub fn history_get_last_message_id(&mut self) -> ClientResult<&mut Self>
Get the id of the last message sent by the client.
Sourcepub fn history_get_message(
&mut self,
msg_id: MessageId,
) -> ClientResult<&mut Self>
pub fn history_get_message( &mut self, msg_id: MessageId, ) -> ClientResult<&mut Self>
Return the text of an history message.
Sourcepub fn history_get_cursor(&mut self) -> ClientResult<&mut Self>
pub fn history_get_cursor(&mut self) -> ClientResult<&mut Self>
Get the id of the message the history cursor is pointing to.
Sourcepub fn history_set_cursor(
&mut self,
scope: ClientScope,
pos: HistoryPosition,
) -> ClientResult<&mut Self>
pub fn history_set_cursor( &mut self, scope: ClientScope, pos: HistoryPosition, ) -> ClientResult<&mut Self>
Set the history cursor position.
Sourcepub fn history_move_cursor(
&mut self,
direction: CursorDirection,
) -> ClientResult<&mut Self>
pub fn history_move_cursor( &mut self, direction: CursorDirection, ) -> ClientResult<&mut Self>
Move the cursor position backward or forward.
Sourcepub fn history_speak(&mut self, msg_id: MessageId) -> ClientResult<&mut Self>
pub fn history_speak(&mut self, msg_id: MessageId) -> ClientResult<&mut Self>
Speak the message from history.
Sourcepub fn history_sort(
&mut self,
direction: SortDirection,
key: SortKey,
) -> ClientResult<&mut Self>
pub fn history_sort( &mut self, direction: SortDirection, key: SortKey, ) -> ClientResult<&mut Self>
Sort messages in history.
Sourcepub fn history_set_short_message_length(
&mut self,
length: u32,
) -> ClientResult<&mut Self>
pub fn history_set_short_message_length( &mut self, length: u32, ) -> ClientResult<&mut Self>
Set the maximum length of short versions of history messages.
Sourcepub fn history_set_ordering(
&mut self,
ordering: Vec<Ordering>,
) -> ClientResult<&mut Self>
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.
Sourcepub fn history_search(
&mut self,
scope: ClientScope,
condition: &str,
) -> ClientResult<&mut Self>
pub fn history_search( &mut self, scope: ClientScope, condition: &str, ) -> ClientResult<&mut Self>
Search in message history.
Sourcepub fn quit(&mut self) -> ClientResult<&mut Self>
pub fn quit(&mut self) -> ClientResult<&mut Self>
Close the connection
Sourcepub fn receive(&mut self) -> ClientResult<Response>
pub fn receive(&mut self) -> ClientResult<Response>
Receive one response.
Sourcepub fn check_status(
&mut self,
expected_code: ReturnCode,
) -> ClientResult<&mut Self>
pub fn check_status( &mut self, expected_code: ReturnCode, ) -> ClientResult<&mut Self>
Check status of answer, discard lines.
Sourcepub fn receive_lines(
&mut self,
expected_code: ReturnCode,
) -> ClientResult<Vec<String>>
pub fn receive_lines( &mut self, expected_code: ReturnCode, ) -> ClientResult<Vec<String>>
Receive lines
Sourcepub fn receive_string(
&mut self,
expected_code: ReturnCode,
) -> ClientResult<String>
pub fn receive_string( &mut self, expected_code: ReturnCode, ) -> ClientResult<String>
Receive a single string
Sourcepub fn receive_i8(&mut self) -> ClientResult<u8>
pub fn receive_i8(&mut self) -> ClientResult<u8>
Receive signed 8-bit integer
Sourcepub fn receive_u8(&mut self) -> ClientResult<u8>
pub fn receive_u8(&mut self) -> ClientResult<u8>
Receive unsigned 8-bit integer
Sourcepub fn receive_cursor_pos(&mut self) -> ClientResult<u16>
pub fn receive_cursor_pos(&mut self) -> ClientResult<u16>
Receive cursor pos
Sourcepub fn receive_message_id(&mut self) -> ClientResult<MessageId>
pub fn receive_message_id(&mut self) -> ClientResult<MessageId>
Receive message id
Sourcepub fn receive_client_id(&mut self) -> ClientResult<ClientId>
pub fn receive_client_id(&mut self) -> ClientResult<ClientId>
Receive client id
Sourcepub fn receive_synthesis_voices(&mut self) -> ClientResult<Vec<SynthesisVoice>>
pub fn receive_synthesis_voices(&mut self) -> ClientResult<Vec<SynthesisVoice>>
Receive a list of synthesis voices
Sourcepub fn receive_event(&mut self) -> ClientResult<Event>
pub fn receive_event(&mut self) -> ClientResult<Event>
Receive a notification
Sourcepub fn receive_history_clients(
&mut self,
) -> ClientResult<Vec<HistoryClientStatus>>
pub fn receive_history_clients( &mut self, ) -> ClientResult<Vec<HistoryClientStatus>>
Receive a list of client status from history.
Sourcepub fn check_client_name_set(&mut self) -> ClientResult<&mut Self>
pub fn check_client_name_set(&mut self) -> ClientResult<&mut Self>
Check the result of set_client_name
.
Sourcepub fn check_receiving_data(&mut self) -> ClientResult<&mut Self>
pub fn check_receiving_data(&mut self) -> ClientResult<&mut Self>
Check if server accept data.