pub struct Speech { /* private fields */ }Expand description
Implements a client for the Cloud Speech-to-Text API.
§Example
let client = Speech::builder().build().await?;
// use `client` to make requests to the Cloud Speech-to-Text API.§Service Description
Enables speech transcription and resource management.
§Configuration
To configure Speech use the with_* methods in the type returned
by builder(). The default configuration should
work for most applications. Common configuration changes include
- with_endpoint(): by default this client uses the global default endpoint
(
https://speech.googleapis.com). Applications using regional endpoints or running in restricted networks (e.g. a network configured override this default. - with_credentials(): by default this client uses Application Default Credentials. Applications using custom authentication may need to override this default.
§Pooling and Cloning
Speech holds a connection pool internally, it is advised to
create one and the reuse it. You do not need to wrap Speech in
an Rc or Arc to reuse it, because it
already uses an Arc internally.
Implementations§
Source§impl Speech
impl Speech
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Returns a builder for Speech.
let client = Speech::builder().build().await?;Sourcepub fn from_stub<T>(stub: T) -> Selfwhere
T: Speech + 'static,
pub fn from_stub<T>(stub: T) -> Selfwhere
T: Speech + 'static,
Creates a new client from the provided stub.
The most common case for calling this function is in tests mocking the client’s behavior.
Sourcepub fn create_recognizer(&self) -> CreateRecognizer
pub fn create_recognizer(&self) -> CreateRecognizer
Creates a Recognizer.
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
Sourcepub fn list_recognizers(&self) -> ListRecognizers
pub fn list_recognizers(&self) -> ListRecognizers
Lists Recognizers.
Sourcepub fn get_recognizer(&self) -> GetRecognizer
pub fn get_recognizer(&self) -> GetRecognizer
Returns the requested Recognizer. Fails with [NOT_FOUND][google.rpc.Code.NOT_FOUND] if the requested Recognizer doesn’t exist.
Sourcepub fn update_recognizer(&self) -> UpdateRecognizer
pub fn update_recognizer(&self) -> UpdateRecognizer
Updates the Recognizer.
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
Sourcepub fn delete_recognizer(&self) -> DeleteRecognizer
pub fn delete_recognizer(&self) -> DeleteRecognizer
Deletes the Recognizer.
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
Sourcepub fn undelete_recognizer(&self) -> UndeleteRecognizer
pub fn undelete_recognizer(&self) -> UndeleteRecognizer
Undeletes the Recognizer.
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
Sourcepub fn recognize(&self) -> Recognize
pub fn recognize(&self) -> Recognize
Performs synchronous Speech recognition: receive results after all audio has been sent and processed.
Sourcepub fn batch_recognize(&self) -> BatchRecognize
pub fn batch_recognize(&self) -> BatchRecognize
Performs batch asynchronous speech recognition: send a request with N audio files and receive a long running operation that can be polled to see when the transcriptions are finished.
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
Sourcepub fn get_config(&self) -> GetConfig
pub fn get_config(&self) -> GetConfig
Returns the requested Config.
Sourcepub fn update_config(&self) -> UpdateConfig
pub fn update_config(&self) -> UpdateConfig
Updates the Config.
Sourcepub fn create_custom_class(&self) -> CreateCustomClass
pub fn create_custom_class(&self) -> CreateCustomClass
Creates a CustomClass.
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
Sourcepub fn list_custom_classes(&self) -> ListCustomClasses
pub fn list_custom_classes(&self) -> ListCustomClasses
Lists CustomClasses.
Sourcepub fn get_custom_class(&self) -> GetCustomClass
pub fn get_custom_class(&self) -> GetCustomClass
Returns the requested CustomClass.
Sourcepub fn update_custom_class(&self) -> UpdateCustomClass
pub fn update_custom_class(&self) -> UpdateCustomClass
Updates the CustomClass.
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
Sourcepub fn delete_custom_class(&self) -> DeleteCustomClass
pub fn delete_custom_class(&self) -> DeleteCustomClass
Deletes the CustomClass.
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
Sourcepub fn undelete_custom_class(&self) -> UndeleteCustomClass
pub fn undelete_custom_class(&self) -> UndeleteCustomClass
Undeletes the CustomClass.
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
Sourcepub fn create_phrase_set(&self) -> CreatePhraseSet
pub fn create_phrase_set(&self) -> CreatePhraseSet
Creates a PhraseSet.
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
Sourcepub fn list_phrase_sets(&self) -> ListPhraseSets
pub fn list_phrase_sets(&self) -> ListPhraseSets
Lists PhraseSets.
Sourcepub fn get_phrase_set(&self) -> GetPhraseSet
pub fn get_phrase_set(&self) -> GetPhraseSet
Returns the requested PhraseSet.
Sourcepub fn update_phrase_set(&self) -> UpdatePhraseSet
pub fn update_phrase_set(&self) -> UpdatePhraseSet
Updates the PhraseSet.
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
Sourcepub fn delete_phrase_set(&self) -> DeletePhraseSet
pub fn delete_phrase_set(&self) -> DeletePhraseSet
Deletes the PhraseSet.
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
Sourcepub fn undelete_phrase_set(&self) -> UndeletePhraseSet
pub fn undelete_phrase_set(&self) -> UndeletePhraseSet
Undeletes the PhraseSet.
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
Sourcepub fn list_locations(&self) -> ListLocations
pub fn list_locations(&self) -> ListLocations
Lists information about the supported locations for this service.
Sourcepub fn get_location(&self) -> GetLocation
pub fn get_location(&self) -> GetLocation
Gets information about a location.
Sourcepub fn list_operations(&self) -> ListOperations
pub fn list_operations(&self) -> ListOperations
Provides the Operations service functionality in this service.
Sourcepub fn get_operation(&self) -> GetOperation
pub fn get_operation(&self) -> GetOperation
Provides the Operations service functionality in this service.
Sourcepub fn delete_operation(&self) -> DeleteOperation
pub fn delete_operation(&self) -> DeleteOperation
Provides the Operations service functionality in this service.
Sourcepub fn cancel_operation(&self) -> CancelOperation
pub fn cancel_operation(&self) -> CancelOperation
Provides the Operations service functionality in this service.