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:
- 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.