#[non_exhaustive]pub struct RecognizeRequest {
pub recognizer: String,
pub config: Option<RecognitionConfig>,
pub config_mask: Option<FieldMask>,
pub audio_source: Option<AudioSource>,
/* private fields */
}Expand description
Request message for the
Recognize method. Either
content or uri must be supplied. Supplying both or neither returns
[INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. See content
limits.
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.
config: Option<RecognitionConfig>Features and audio metadata to use for the Automatic Speech Recognition. This field in combination with the config_mask field can be used to override parts of the default_recognition_config of the Recognizer resource.
config_mask: Option<FieldMask>The list of fields in
config that override the
values in the
default_recognition_config
of the recognizer during this recognition request. If no mask is provided,
all non-default valued fields in
config override the
values in the recognizer for this recognition request. If a mask is
provided, only the fields listed in the mask override the config in the
recognizer for this recognition request. If a wildcard (*) is provided,
config completely
overrides and replaces the config in the recognizer for this recognition
request.
audio_source: Option<AudioSource>The audio source, which is either inline content or a Google Cloud Storage URI.
Implementations§
Source§impl RecognizeRequest
impl RecognizeRequest
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 = RecognizeRequest::new().set_recognizer(format!("projects/{project_id}/locations/{location_id}/recognizers/{recognizer_id}"));Sourcepub fn set_config<T>(self, v: T) -> Selfwhere
T: Into<RecognitionConfig>,
pub fn set_config<T>(self, v: T) -> Selfwhere
T: Into<RecognitionConfig>,
Sourcepub fn set_or_clear_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<RecognitionConfig>,
pub fn set_or_clear_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<RecognitionConfig>,
Sourcepub fn set_config_mask<T>(self, v: T) -> Self
pub fn set_config_mask<T>(self, v: T) -> Self
Sets the value of config_mask.
§Example
use wkt::FieldMask;
let x = RecognizeRequest::new().set_config_mask(FieldMask::default()/* use setters */);Sourcepub fn set_or_clear_config_mask<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_config_mask<T>(self, v: Option<T>) -> Self
Sets or clears the value of config_mask.
§Example
use wkt::FieldMask;
let x = RecognizeRequest::new().set_or_clear_config_mask(Some(FieldMask::default()/* use setters */));
let x = RecognizeRequest::new().set_or_clear_config_mask(None::<FieldMask>);Sourcepub fn set_audio_source<T: Into<Option<AudioSource>>>(self, v: T) -> Self
pub fn set_audio_source<T: Into<Option<AudioSource>>>(self, v: T) -> Self
Sets the value of audio_source.
Note that all the setters affecting audio_source are mutually
exclusive.
§Example
use google_cloud_speech_v2::model::recognize_request::AudioSource;
let x = RecognizeRequest::new().set_audio_source(Some(AudioSource::Content(bytes::Bytes::from_static(b"example"))));Sourcepub fn content(&self) -> Option<&Bytes>
pub fn content(&self) -> Option<&Bytes>
The value of audio_source
if it holds a Content, None if the field is not set or
holds a different branch.
Sourcepub fn set_content<T: Into<Bytes>>(self, v: T) -> Self
pub fn set_content<T: Into<Bytes>>(self, v: T) -> Self
Sets the value of audio_source
to hold a Content.
Note that all the setters affecting audio_source are
mutually exclusive.
§Example
let x = RecognizeRequest::new().set_content(bytes::Bytes::from_static(b"example"));
assert!(x.content().is_some());
assert!(x.uri().is_none());Sourcepub fn uri(&self) -> Option<&String>
pub fn uri(&self) -> Option<&String>
The value of audio_source
if it holds a Uri, None if the field is not set or
holds a different branch.
Trait Implementations§
Source§impl Clone for RecognizeRequest
impl Clone for RecognizeRequest
Source§fn clone(&self) -> RecognizeRequest
fn clone(&self) -> RecognizeRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RecognizeRequest
impl Debug for RecognizeRequest
Source§impl Default for RecognizeRequest
impl Default for RecognizeRequest
Source§fn default() -> RecognizeRequest
fn default() -> RecognizeRequest
Source§impl Message for RecognizeRequest
impl Message for RecognizeRequest
Source§impl PartialEq for RecognizeRequest
impl PartialEq for RecognizeRequest
impl StructuralPartialEq for RecognizeRequest
Auto Trait Implementations§
impl !Freeze for RecognizeRequest
impl RefUnwindSafe for RecognizeRequest
impl Send for RecognizeRequest
impl Sync for RecognizeRequest
impl Unpin for RecognizeRequest
impl UnsafeUnpin for RecognizeRequest
impl UnwindSafe for RecognizeRequest
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request