[][src]Struct dapr::client::Client

pub struct Client<T>(_);

Implementations

impl<T: DaprInterface> Client<T>[src]

pub async fn connect(addr: String) -> Result<Self, Error>[src]

Connect to a Dapr enabled app.

Arguments

  • addr - Address of gRPC server to connect to.

pub async fn invoke_service<I, M>(
    &mut self,
    app_id: I,
    method_name: M,
    data: Option<Any>
) -> Result<InvokeServiceResponse, Error> where
    I: Into<String>,
    M: Into<String>, 
[src]

Invoke a method in a Dapr enabled app.

Arguments

  • app_id - Id of the application running.
  • method_name - Name of the method to invoke.
  • data - Required. Bytes value or data required to invoke service.

pub async fn invoke_binding<S>(
    &mut self,
    name: S,
    data: Vec<u8>
) -> Result<InvokeBindingResponse, Error> where
    S: Into<String>, 
[src]

Invoke an Dapr output binding.

Arguments

  • name - The name of the output binding to invoke.
  • data - The data which will be sent to the output binding.

pub async fn publish_event<S>(
    &mut self,
    pubsub_name: S,
    topic: S,
    data_content_type: S,
    data: Vec<u8>,
    metadata: Option<HashMap<String, String>>
) -> Result<(), Error> where
    S: Into<String>, 
[src]

Publish a payload to multiple consumers who are listening on a topic.

Dapr guarantees at least once semantics for this endpoint.

Arguments

  • pubsub_name - Name of the pubsub component
  • topic - Pubsub topic.
  • data - The data which will be published to topic.

pub async fn get_secret<S>(
    &mut self,
    store_name: S,
    key: S
) -> Result<GetSecretResponse, Error> where
    S: Into<String>, 
[src]

Get the secret for a specific key.

Arguments

  • store_name - The name of secret store.
  • key - The name of secret key.

pub async fn get_state<S>(
    &mut self,
    store_name: S,
    key: S,
    metadata: Option<HashMap<String, String>>
) -> Result<GetStateResponse, Error> where
    S: Into<String>, 
[src]

Get the state for a specific key.

Arguments

  • store_name - The name of state store.
  • key - The key of the desired state.

pub async fn save_state<I, K>(
    &mut self,
    store_name: K,
    states: I
) -> Result<(), Error> where
    I: IntoIterator<Item = (K, Vec<u8>)>,
    K: Into<String>, 
[src]

Save an array of state objects.

Arguments

  • store_name - The name of state store.
  • states - The array of the state key values.

pub async fn delete_bulk_state<I, K>(
    &mut self,
    store_name: K,
    states: I
) -> Result<(), Error> where
    I: IntoIterator<Item = (K, Vec<u8>)>,
    K: Into<String>, 
[src]

Delete an array of state objects.

Arguments

  • store_name - The name of state store.
  • states - The array of the state key values.

pub async fn delete_state<S>(
    &mut self,
    store_name: S,
    key: S,
    metadata: Option<HashMap<String, String>>
) -> Result<(), Error> where
    S: Into<String>, 
[src]

Delete the state for a specific key.

Arguments

  • store_name - The name of state store.
  • key - The key of the desired state.

pub async fn set_metadata<S>(&mut self, key: S, value: S) -> Result<(), Error> where
    S: Into<String>, 
[src]

Set sidecar Metadata

Arguments

  • key - The metadata key
  • value - The metadata value

pub async fn get_metadata(&mut self) -> Result<GetMetadataResponse, Error>[src]

Set sidecar Metadata

Auto Trait Implementations

impl<T> RefUnwindSafe for Client<T> where
    T: RefUnwindSafe
[src]

impl<T> Send for Client<T> where
    T: Send
[src]

impl<T> Sync for Client<T> where
    T: Sync
[src]

impl<T> Unpin for Client<T> where
    T: Unpin
[src]

impl<T> UnwindSafe for Client<T> where
    T: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> IntoRequest<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

impl<T> WithSubscriber for T[src]