#[non_exhaustive]pub struct StreamingRecognizeRequest {
pub recognizer: String,
pub streaming_request: Option<StreamingRequest>,
/* private fields */
}Expand description
Request message for the [StreamingRecognize][google.cloud.speech.v2.Speech.StreamingRecognize] method. Multiple StreamingRecognizeRequest messages are sent in one call.
If the Recognizer referenced by recognizer contains a fully specified request configuration then the stream may only contain messages with only audio set.
Otherwise the first message must contain a recognizer and a streaming_config message that together fully specify the request configuration and must not contain audio. All subsequent messages must only have audio set.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.recognizer: StringRequired. The name of the Recognizer to use during recognition. The
expected format is
projects/{project}/locations/{location}/recognizers/{recognizer}. The
{recognizer} segment may be set to _ to use an empty implicit Recognizer.
streaming_request: Option<StreamingRequest>Implementations§
Source§impl StreamingRecognizeRequest
impl StreamingRecognizeRequest
pub fn new() -> Self
Sourcepub fn set_recognizer<T: Into<String>>(self, v: T) -> Self
pub fn set_recognizer<T: Into<String>>(self, v: T) -> Self
Sets the value of recognizer.
§Example
let x = StreamingRecognizeRequest::new().set_recognizer("example");Sourcepub fn set_streaming_request<T: Into<Option<StreamingRequest>>>(
self,
v: T,
) -> Self
pub fn set_streaming_request<T: Into<Option<StreamingRequest>>>( self, v: T, ) -> Self
Sets the value of streaming_request.
Note that all the setters affecting streaming_request are mutually
exclusive.
§Example
use google_cloud_speech_v2::model::streaming_recognize_request::StreamingRequest;
let x = StreamingRecognizeRequest::new().set_streaming_request(Some(StreamingRequest::Audio(bytes::Bytes::from_static(b"example"))));Sourcepub fn streaming_config(&self) -> Option<&Box<StreamingRecognitionConfig>>
pub fn streaming_config(&self) -> Option<&Box<StreamingRecognitionConfig>>
The value of streaming_request
if it holds a StreamingConfig, None if the field is not set or
holds a different branch.
Sourcepub fn set_streaming_config<T: Into<Box<StreamingRecognitionConfig>>>(
self,
v: T,
) -> Self
pub fn set_streaming_config<T: Into<Box<StreamingRecognitionConfig>>>( self, v: T, ) -> Self
Sets the value of streaming_request
to hold a StreamingConfig.
Note that all the setters affecting streaming_request are
mutually exclusive.
§Example
use google_cloud_speech_v2::model::StreamingRecognitionConfig;
let x = StreamingRecognizeRequest::new().set_streaming_config(StreamingRecognitionConfig::default()/* use setters */);
assert!(x.streaming_config().is_some());
assert!(x.audio().is_none());Sourcepub fn audio(&self) -> Option<&Bytes>
pub fn audio(&self) -> Option<&Bytes>
The value of streaming_request
if it holds a Audio, None if the field is not set or
holds a different branch.
Sourcepub fn set_audio<T: Into<Bytes>>(self, v: T) -> Self
pub fn set_audio<T: Into<Bytes>>(self, v: T) -> Self
Sets the value of streaming_request
to hold a Audio.
Note that all the setters affecting streaming_request are
mutually exclusive.
§Example
let x = StreamingRecognizeRequest::new().set_audio(bytes::Bytes::from_static(b"example"));
assert!(x.audio().is_some());
assert!(x.streaming_config().is_none());Trait Implementations§
Source§impl Clone for StreamingRecognizeRequest
impl Clone for StreamingRecognizeRequest
Source§fn clone(&self) -> StreamingRecognizeRequest
fn clone(&self) -> StreamingRecognizeRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more