Skip to main content

StreamsService

Struct StreamsService 

Source
pub struct StreamsService { /* private fields */ }
Expand description

Implements a client for the Vision AI API.

§Example

use google_cloud_gax::paginator::ItemPaginator as _;
async fn sample(
   project_id: &str,
   location_id: &str,
   cluster_id: &str,
) -> anyhow::Result<()> {
    let client = StreamsService::builder().build().await?;
    let mut list = client.list_streams()
        .set_parent(format!("projects/{project_id}/locations/{location_id}/clusters/{cluster_id}"))
        .by_item();
    while let Some(item) = list.next().await.transpose()? {
        println!("{:?}", item);
    }
    Ok(())
}

§Service Description

Service describing handlers for resources. Vision API and Vision AI API are two independent APIs developed by the same team. Vision API is for people to annotate their image while Vision AI is an e2e solution for customer to build their own computer vision application.

§Configuration

To configure StreamsService use the with_* methods in the type returned by builder(). The default configuration should work for most applications. Common configuration changes include

§Pooling and Cloning

StreamsService holds a connection pool internally, it is advised to create one and reuse it. You do not need to wrap StreamsService in an Rc or Arc to reuse it, because it already uses an Arc internally.

Implementations§

Source§

impl StreamsService

Source

pub fn builder() -> ClientBuilder

Returns a builder for StreamsService.

let client = StreamsService::builder().build().await?;
Source

pub fn from_stub<T>(stub: impl Into<Arc<T>>) -> Self
where T: StreamsService + '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.

Source

pub fn list_clusters(&self) -> ListClusters

Lists Clusters in a given project and location.

§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_visionai_v1::Result;
async fn sample(
   client: &StreamsService, parent: &str
) -> Result<()> {
    let mut list = client.list_clusters()
        .set_parent(parent)
        .by_item();
    while let Some(item) = list.next().await.transpose()? {
        println!("{:?}", item);
    }
    Ok(())
}
Source

pub fn get_cluster(&self) -> GetCluster

Gets details of a single Cluster.

§Example
use google_cloud_visionai_v1::Result;
async fn sample(
   client: &StreamsService, project_id: &str, location_id: &str, cluster_id: &str
) -> Result<()> {
    let response = client.get_cluster()
        .set_name(format!("projects/{project_id}/locations/{location_id}/clusters/{cluster_id}"))
        .send().await?;
    println!("response {:?}", response);
    Ok(())
}
Source

pub fn create_cluster(&self) -> CreateCluster

Creates a new Cluster in a given project and location.

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

§Example
use google_cloud_lro::Poller;
use google_cloud_visionai_v1::model::Cluster;
use google_cloud_visionai_v1::Result;
async fn sample(
   client: &StreamsService, project_id: &str, location_id: &str
) -> Result<()> {
    let response = client.create_cluster()
        .set_parent(format!("projects/{project_id}/locations/{location_id}"))
        .set_cluster_id("cluster_id_value")
        .set_cluster(
            Cluster::new()/* set fields */
        )
        .poller().until_done().await?;
    println!("response {:?}", response);
    Ok(())
}
Source

pub fn update_cluster(&self) -> UpdateCluster

Updates the parameters of a single Cluster.

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

§Example
use google_cloud_lro::Poller;
use google_cloud_wkt::FieldMask;
use google_cloud_visionai_v1::model::Cluster;
use google_cloud_visionai_v1::Result;
async fn sample(
   client: &StreamsService, project_id: &str, location_id: &str, cluster_id: &str
) -> Result<()> {
    let response = client.update_cluster()
        .set_cluster(
            Cluster::new().set_name(format!("projects/{project_id}/locations/{location_id}/clusters/{cluster_id}"))/* set fields */
        )
        .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
        .poller().until_done().await?;
    println!("response {:?}", response);
    Ok(())
}
Source

pub fn delete_cluster(&self) -> DeleteCluster

Deletes a single Cluster.

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

§Example
use google_cloud_lro::Poller;
use google_cloud_visionai_v1::Result;
async fn sample(
   client: &StreamsService, project_id: &str, location_id: &str, cluster_id: &str
) -> Result<()> {
    client.delete_cluster()
        .set_name(format!("projects/{project_id}/locations/{location_id}/clusters/{cluster_id}"))
        .poller().until_done().await?;
    Ok(())
}
Source

pub fn list_streams(&self) -> ListStreams

Lists Streams in a given project and location.

§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_visionai_v1::Result;
async fn sample(
   client: &StreamsService, project_id: &str, location_id: &str, cluster_id: &str
) -> Result<()> {
    let mut list = client.list_streams()
        .set_parent(format!("projects/{project_id}/locations/{location_id}/clusters/{cluster_id}"))
        .by_item();
    while let Some(item) = list.next().await.transpose()? {
        println!("{:?}", item);
    }
    Ok(())
}
Source

pub fn get_stream(&self) -> GetStream

Gets details of a single Stream.

§Example
use google_cloud_visionai_v1::Result;
async fn sample(
   client: &StreamsService, project_id: &str, location_id: &str, cluster_id: &str, stream_id: &str
) -> Result<()> {
    let response = client.get_stream()
        .set_name(format!("projects/{project_id}/locations/{location_id}/clusters/{cluster_id}/streams/{stream_id}"))
        .send().await?;
    println!("response {:?}", response);
    Ok(())
}
Source

pub fn create_stream(&self) -> CreateStream

Creates a new Stream in a given project and location.

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

§Example
use google_cloud_lro::Poller;
use google_cloud_visionai_v1::model::Stream;
use google_cloud_visionai_v1::Result;
async fn sample(
   client: &StreamsService, project_id: &str, location_id: &str, cluster_id: &str
) -> Result<()> {
    let response = client.create_stream()
        .set_parent(format!("projects/{project_id}/locations/{location_id}/clusters/{cluster_id}"))
        .set_stream_id("stream_id_value")
        .set_stream(
            Stream::new()/* set fields */
        )
        .poller().until_done().await?;
    println!("response {:?}", response);
    Ok(())
}
Source

pub fn update_stream(&self) -> UpdateStream

Updates the parameters of a single Stream.

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

§Example
use google_cloud_lro::Poller;
use google_cloud_wkt::FieldMask;
use google_cloud_visionai_v1::model::Stream;
use google_cloud_visionai_v1::Result;
async fn sample(
   client: &StreamsService, project_id: &str, location_id: &str, cluster_id: &str, stream_id: &str
) -> Result<()> {
    let response = client.update_stream()
        .set_stream(
            Stream::new().set_name(format!("projects/{project_id}/locations/{location_id}/clusters/{cluster_id}/streams/{stream_id}"))/* set fields */
        )
        .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
        .poller().until_done().await?;
    println!("response {:?}", response);
    Ok(())
}
Source

pub fn delete_stream(&self) -> DeleteStream

Deletes a single Stream.

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

§Example
use google_cloud_lro::Poller;
use google_cloud_visionai_v1::Result;
async fn sample(
   client: &StreamsService, project_id: &str, location_id: &str, cluster_id: &str, stream_id: &str
) -> Result<()> {
    client.delete_stream()
        .set_name(format!("projects/{project_id}/locations/{location_id}/clusters/{cluster_id}/streams/{stream_id}"))
        .poller().until_done().await?;
    Ok(())
}
Source

pub fn get_stream_thumbnail(&self) -> GetStreamThumbnail

Gets the thumbnail (image snapshot) of a single Stream.

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

§Example
use google_cloud_lro::Poller;
use google_cloud_visionai_v1::Result;
async fn sample(
   client: &StreamsService
) -> Result<()> {
    let response = client.get_stream_thumbnail()
        /* set fields */
        .poller().until_done().await?;
    println!("response {:?}", response);
    Ok(())
}
Source

pub fn generate_stream_hls_token(&self) -> GenerateStreamHlsToken

Generate the JWT auth token required to get the stream HLS contents.

§Example
use google_cloud_visionai_v1::Result;
async fn sample(
   client: &StreamsService
) -> Result<()> {
    let response = client.generate_stream_hls_token()
        /* set fields */
        .send().await?;
    println!("response {:?}", response);
    Ok(())
}
Source

pub fn list_events(&self) -> ListEvents

Lists Events in a given project and location.

§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_visionai_v1::Result;
async fn sample(
   client: &StreamsService, project_id: &str, location_id: &str, cluster_id: &str
) -> Result<()> {
    let mut list = client.list_events()
        .set_parent(format!("projects/{project_id}/locations/{location_id}/clusters/{cluster_id}"))
        .by_item();
    while let Some(item) = list.next().await.transpose()? {
        println!("{:?}", item);
    }
    Ok(())
}
Source

pub fn get_event(&self) -> GetEvent

Gets details of a single Event.

§Example
use google_cloud_visionai_v1::Result;
async fn sample(
   client: &StreamsService, project_id: &str, location_id: &str, cluster_id: &str, event_id: &str
) -> Result<()> {
    let response = client.get_event()
        .set_name(format!("projects/{project_id}/locations/{location_id}/clusters/{cluster_id}/events/{event_id}"))
        .send().await?;
    println!("response {:?}", response);
    Ok(())
}
Source

pub fn create_event(&self) -> CreateEvent

Creates a new Event in a given project and location.

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

§Example
use google_cloud_lro::Poller;
use google_cloud_visionai_v1::model::Event;
use google_cloud_visionai_v1::Result;
async fn sample(
   client: &StreamsService, project_id: &str, location_id: &str, cluster_id: &str
) -> Result<()> {
    let response = client.create_event()
        .set_parent(format!("projects/{project_id}/locations/{location_id}/clusters/{cluster_id}"))
        .set_event_id("event_id_value")
        .set_event(
            Event::new()/* set fields */
        )
        .poller().until_done().await?;
    println!("response {:?}", response);
    Ok(())
}
Source

pub fn update_event(&self) -> UpdateEvent

Updates the parameters of a single Event.

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

§Example
use google_cloud_lro::Poller;
use google_cloud_wkt::FieldMask;
use google_cloud_visionai_v1::model::Event;
use google_cloud_visionai_v1::Result;
async fn sample(
   client: &StreamsService, project_id: &str, location_id: &str, cluster_id: &str, event_id: &str
) -> Result<()> {
    let response = client.update_event()
        .set_event(
            Event::new().set_name(format!("projects/{project_id}/locations/{location_id}/clusters/{cluster_id}/events/{event_id}"))/* set fields */
        )
        .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
        .poller().until_done().await?;
    println!("response {:?}", response);
    Ok(())
}
Source

pub fn delete_event(&self) -> DeleteEvent

Deletes a single Event.

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

§Example
use google_cloud_lro::Poller;
use google_cloud_visionai_v1::Result;
async fn sample(
   client: &StreamsService, project_id: &str, location_id: &str, cluster_id: &str, event_id: &str
) -> Result<()> {
    client.delete_event()
        .set_name(format!("projects/{project_id}/locations/{location_id}/clusters/{cluster_id}/events/{event_id}"))
        .poller().until_done().await?;
    Ok(())
}
Source

pub fn list_series(&self) -> ListSeries

Lists Series in a given project and location.

§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_visionai_v1::Result;
async fn sample(
   client: &StreamsService, project_id: &str, location_id: &str, cluster_id: &str
) -> Result<()> {
    let mut list = client.list_series()
        .set_parent(format!("projects/{project_id}/locations/{location_id}/clusters/{cluster_id}"))
        .by_item();
    while let Some(item) = list.next().await.transpose()? {
        println!("{:?}", item);
    }
    Ok(())
}
Source

pub fn get_series(&self) -> GetSeries

Gets details of a single Series.

§Example
use google_cloud_visionai_v1::Result;
async fn sample(
   client: &StreamsService, project_id: &str, location_id: &str, cluster_id: &str, series_id: &str
) -> Result<()> {
    let response = client.get_series()
        .set_name(format!("projects/{project_id}/locations/{location_id}/clusters/{cluster_id}/series/{series_id}"))
        .send().await?;
    println!("response {:?}", response);
    Ok(())
}
Source

pub fn create_series(&self) -> CreateSeries

Creates a new Series in a given project and location.

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

§Example
use google_cloud_lro::Poller;
use google_cloud_visionai_v1::model::Series;
use google_cloud_visionai_v1::Result;
async fn sample(
   client: &StreamsService, project_id: &str, location_id: &str, cluster_id: &str
) -> Result<()> {
    let response = client.create_series()
        .set_parent(format!("projects/{project_id}/locations/{location_id}/clusters/{cluster_id}"))
        .set_series_id("series_id_value")
        .set_series(
            Series::new()/* set fields */
        )
        .poller().until_done().await?;
    println!("response {:?}", response);
    Ok(())
}
Source

pub fn update_series(&self) -> UpdateSeries

Updates the parameters of a single Event.

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

§Example
use google_cloud_lro::Poller;
use google_cloud_wkt::FieldMask;
use google_cloud_visionai_v1::model::Series;
use google_cloud_visionai_v1::Result;
async fn sample(
   client: &StreamsService, project_id: &str, location_id: &str, cluster_id: &str, series_id: &str
) -> Result<()> {
    let response = client.update_series()
        .set_series(
            Series::new().set_name(format!("projects/{project_id}/locations/{location_id}/clusters/{cluster_id}/series/{series_id}"))/* set fields */
        )
        .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
        .poller().until_done().await?;
    println!("response {:?}", response);
    Ok(())
}
Source

pub fn delete_series(&self) -> DeleteSeries

Deletes a single Series.

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

§Example
use google_cloud_lro::Poller;
use google_cloud_visionai_v1::Result;
async fn sample(
   client: &StreamsService, project_id: &str, location_id: &str, cluster_id: &str, series_id: &str
) -> Result<()> {
    client.delete_series()
        .set_name(format!("projects/{project_id}/locations/{location_id}/clusters/{cluster_id}/series/{series_id}"))
        .poller().until_done().await?;
    Ok(())
}
Source

pub fn materialize_channel(&self) -> MaterializeChannel

Materialize a channel.

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

§Example
use google_cloud_lro::Poller;
use google_cloud_visionai_v1::Result;
async fn sample(
   client: &StreamsService
) -> Result<()> {
    let response = client.materialize_channel()
        /* set fields */
        .poller().until_done().await?;
    println!("response {:?}", response);
    Ok(())
}
Source

pub fn list_locations(&self) -> ListLocations

Lists information about the supported locations for this service.

§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_visionai_v1::Result;
async fn sample(
   client: &StreamsService
) -> Result<()> {
    let mut list = client.list_locations()
        /* set fields */
        .by_item();
    while let Some(item) = list.next().await.transpose()? {
        println!("{:?}", item);
    }
    Ok(())
}
Source

pub fn get_location(&self) -> GetLocation

Gets information about a location.

§Example
use google_cloud_visionai_v1::Result;
async fn sample(
   client: &StreamsService
) -> Result<()> {
    let response = client.get_location()
        /* set fields */
        .send().await?;
    println!("response {:?}", response);
    Ok(())
}
Source

pub fn list_operations(&self) -> ListOperations

Provides the Operations service functionality in this service.

§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_visionai_v1::Result;
async fn sample(
   client: &StreamsService
) -> Result<()> {
    let mut list = client.list_operations()
        /* set fields */
        .by_item();
    while let Some(item) = list.next().await.transpose()? {
        println!("{:?}", item);
    }
    Ok(())
}
Source

pub fn get_operation(&self) -> GetOperation

Provides the Operations service functionality in this service.

§Example
use google_cloud_visionai_v1::Result;
async fn sample(
   client: &StreamsService
) -> Result<()> {
    let response = client.get_operation()
        /* set fields */
        .send().await?;
    println!("response {:?}", response);
    Ok(())
}
Source

pub fn delete_operation(&self) -> DeleteOperation

Provides the Operations service functionality in this service.

§Example
use google_cloud_visionai_v1::Result;
async fn sample(
   client: &StreamsService
) -> Result<()> {
    client.delete_operation()
        /* set fields */
        .send().await?;
    Ok(())
}
Source

pub fn cancel_operation(&self) -> CancelOperation

Provides the Operations service functionality in this service.

§Example
use google_cloud_visionai_v1::Result;
async fn sample(
   client: &StreamsService
) -> Result<()> {
    client.cancel_operation()
        /* set fields */
        .send().await?;
    Ok(())
}

Trait Implementations§

Source§

impl Clone for StreamsService

Source§

fn clone(&self) -> StreamsService

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for StreamsService

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more