#[non_exhaustive]pub struct StreamingRecognitionFeatures {
pub enable_voice_activity_events: bool,
pub interim_results: bool,
pub voice_activity_timeout: Option<VoiceActivityTimeout>,
/* private fields */
}Expand description
Available recognition features specific to streaming recognition requests.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.enable_voice_activity_events: boolIf true, responses with voice activity speech events will be returned as
they are detected.
interim_results: boolWhether or not to stream interim results to the client. If set to true, interim results will be streamed to the client. Otherwise, only the final response will be streamed back.
voice_activity_timeout: Option<VoiceActivityTimeout>If set, the server will automatically close the stream after the specified
duration has elapsed after the last VOICE_ACTIVITY speech event has been
sent. The field voice_activity_events must also be set to true.
Implementations§
Source§impl StreamingRecognitionFeatures
impl StreamingRecognitionFeatures
pub fn new() -> Self
Sourcepub fn set_enable_voice_activity_events<T: Into<bool>>(self, v: T) -> Self
pub fn set_enable_voice_activity_events<T: Into<bool>>(self, v: T) -> Self
Sets the value of enable_voice_activity_events.
§Example
ⓘ
let x = StreamingRecognitionFeatures::new().set_enable_voice_activity_events(true);Sourcepub fn set_interim_results<T: Into<bool>>(self, v: T) -> Self
pub fn set_interim_results<T: Into<bool>>(self, v: T) -> Self
Sets the value of interim_results.
§Example
ⓘ
let x = StreamingRecognitionFeatures::new().set_interim_results(true);Sourcepub fn set_voice_activity_timeout<T>(self, v: T) -> Selfwhere
T: Into<VoiceActivityTimeout>,
pub fn set_voice_activity_timeout<T>(self, v: T) -> Selfwhere
T: Into<VoiceActivityTimeout>,
Sets the value of voice_activity_timeout.
§Example
ⓘ
use google_cloud_speech_v2::model::streaming_recognition_features::VoiceActivityTimeout;
let x = StreamingRecognitionFeatures::new().set_voice_activity_timeout(VoiceActivityTimeout::default()/* use setters */);Sourcepub fn set_or_clear_voice_activity_timeout<T>(self, v: Option<T>) -> Selfwhere
T: Into<VoiceActivityTimeout>,
pub fn set_or_clear_voice_activity_timeout<T>(self, v: Option<T>) -> Selfwhere
T: Into<VoiceActivityTimeout>,
Sets or clears the value of voice_activity_timeout.
§Example
ⓘ
use google_cloud_speech_v2::model::streaming_recognition_features::VoiceActivityTimeout;
let x = StreamingRecognitionFeatures::new().set_or_clear_voice_activity_timeout(Some(VoiceActivityTimeout::default()/* use setters */));
let x = StreamingRecognitionFeatures::new().set_or_clear_voice_activity_timeout(None::<VoiceActivityTimeout>);Trait Implementations§
Source§impl Clone for StreamingRecognitionFeatures
impl Clone for StreamingRecognitionFeatures
Source§fn clone(&self) -> StreamingRecognitionFeatures
fn clone(&self) -> StreamingRecognitionFeatures
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StreamingRecognitionFeatures
impl Debug for StreamingRecognitionFeatures
Source§impl Default for StreamingRecognitionFeatures
impl Default for StreamingRecognitionFeatures
Source§fn default() -> StreamingRecognitionFeatures
fn default() -> StreamingRecognitionFeatures
Returns the “default value” for a type. Read more
Source§impl PartialEq for StreamingRecognitionFeatures
impl PartialEq for StreamingRecognitionFeatures
Source§fn eq(&self, other: &StreamingRecognitionFeatures) -> bool
fn eq(&self, other: &StreamingRecognitionFeatures) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for StreamingRecognitionFeatures
Auto Trait Implementations§
impl Freeze for StreamingRecognitionFeatures
impl RefUnwindSafe for StreamingRecognitionFeatures
impl Send for StreamingRecognitionFeatures
impl Sync for StreamingRecognitionFeatures
impl Unpin for StreamingRecognitionFeatures
impl UnwindSafe for StreamingRecognitionFeatures
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more