pub struct Client<T>(/* private fields */);
Implementations§
source§impl<T: DaprInterface> Client<T>
impl<T: DaprInterface> Client<T>
sourcepub async fn invoke_service<I, M>(
&mut self,
app_id: I,
method_name: M,
data: Option<Any>
) -> Result<InvokeServiceResponse, Error>
pub async fn invoke_service<I, M>( &mut self, app_id: I, method_name: M, data: Option<Any> ) -> Result<InvokeServiceResponse, Error>
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.
sourcepub async fn invoke_binding<S>(
&mut self,
name: S,
data: Vec<u8>
) -> Result<InvokeBindingResponse, Error>
pub async fn invoke_binding<S>( &mut self, name: S, data: Vec<u8> ) -> Result<InvokeBindingResponse, Error>
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.
sourcepub 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>
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>
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 componenttopic
- Pubsub topic.data
- The data which will be published to topic.
sourcepub async fn get_secret<S>(
&mut self,
store_name: S,
key: S
) -> Result<GetSecretResponse, Error>
pub async fn get_secret<S>( &mut self, store_name: S, key: S ) -> Result<GetSecretResponse, Error>
Get the secret for a specific key.
§Arguments
store_name
- The name of secret store.key
- The name of secret key.
sourcepub async fn get_state<S>(
&mut self,
store_name: S,
key: S,
metadata: Option<HashMap<String, String>>
) -> Result<GetStateResponse, Error>
pub async fn get_state<S>( &mut self, store_name: S, key: S, metadata: Option<HashMap<String, String>> ) -> Result<GetStateResponse, Error>
Get the state for a specific key.
§Arguments
store_name
- The name of state store.key
- The key of the desired state.
sourcepub async fn save_state<I, K>(
&mut self,
store_name: K,
states: I
) -> Result<(), Error>
pub async fn save_state<I, K>( &mut self, store_name: K, states: I ) -> Result<(), Error>
Save an array of state objects.
§Arguments
store_name
- The name of state store.states
- The array of the state key values.
sourcepub async fn delete_bulk_state<I, K>(
&mut self,
store_name: K,
states: I
) -> Result<(), Error>
pub async fn delete_bulk_state<I, K>( &mut self, store_name: K, states: I ) -> Result<(), Error>
Delete an array of state objects.
§Arguments
store_name
- The name of state store.states
- The array of the state key values.
sourcepub async fn delete_state<S>(
&mut self,
store_name: S,
key: S,
metadata: Option<HashMap<String, String>>
) -> Result<(), Error>
pub async fn delete_state<S>( &mut self, store_name: S, key: S, metadata: Option<HashMap<String, String>> ) -> Result<(), Error>
Delete the state for a specific key.
§Arguments
store_name
- The name of state store.key
- The key of the desired state.
sourcepub async fn set_metadata<S>(&mut self, key: S, value: S) -> Result<(), Error>
pub async fn set_metadata<S>(&mut self, key: S, value: S) -> Result<(), Error>
sourcepub async fn get_metadata(&mut self) -> Result<GetMetadataResponse, Error>
pub async fn get_metadata(&mut self) -> Result<GetMetadataResponse, Error>
Set sidecar Metadata
sourcepub async fn invoke_actor<I, M, TInput, TOutput>(
&mut self,
actor_type: I,
actor_id: I,
method_name: M,
input: TInput,
metadata: Option<HashMap<String, String>>
) -> Result<TOutput, Error>
pub async fn invoke_actor<I, M, TInput, TOutput>( &mut self, actor_type: I, actor_id: I, method_name: M, input: TInput, metadata: Option<HashMap<String, String>> ) -> Result<TOutput, Error>
Invoke a method in a Dapr actor.
§Arguments
actor_type
- Type of the actor.actor_id
- Id of the actor.method_name
- Name of the method to invoke.input
- Required. Data required to invoke service, should be json serializable.
sourcepub async fn get_configuration<S, K>(
&mut self,
store_name: S,
keys: Vec<K>,
metadata: Option<HashMap<String, String>>
) -> Result<GetConfigurationResponse, Error>
pub async fn get_configuration<S, K>( &mut self, store_name: S, keys: Vec<K>, metadata: Option<HashMap<String, String>> ) -> Result<GetConfigurationResponse, Error>
Get the configuration for a specific key ///
§Arguments
store_name
- The name of config store.keys
- The key of the desired configuration.
sourcepub async fn subscribe_configuration<S>(
&mut self,
store_name: S,
keys: Vec<S>,
metadata: Option<HashMap<String, String>>
) -> Result<Streaming<SubscribeConfigurationResponse>, Error>
pub async fn subscribe_configuration<S>( &mut self, store_name: S, keys: Vec<S>, metadata: Option<HashMap<String, String>> ) -> Result<Streaming<SubscribeConfigurationResponse>, Error>
Subscribe to configuration changes
sourcepub async fn unsubscribe_configuration<S>(
&mut self,
store_name: S,
id: S
) -> Result<UnsubscribeConfigurationResponse, Error>
pub async fn unsubscribe_configuration<S>( &mut self, store_name: S, id: S ) -> Result<UnsubscribeConfigurationResponse, Error>
Unsubscribe from configuration changes
Trait Implementations§
Auto Trait Implementations§
impl<T> RefUnwindSafe for Client<T>where
T: RefUnwindSafe,
impl<T> Send for Client<T>where
T: Send,
impl<T> Sync for Client<T>where
T: Sync,
impl<T> Unpin for Client<T>where
T: Unpin,
impl<T> UnwindSafe for Client<T>where
T: UnwindSafe,
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
Mutably borrows from an owned value. Read more
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>
Wrap the input message
T
in a tonic::Request