@@ -51,16 +51,20 @@ impl<T: DaprInterface> Client<T> {
51
51
. await
52
52
}
53
53
54
- /// Invoke an Dapr output binding.
54
+ /// Invoke a Dapr output binding.
55
55
///
56
56
/// # Arguments
57
57
///
58
58
/// * `name` - The name of the output binding to invoke.
59
59
/// * `data` - The data which will be sent to the output binding.
60
+ /// * `metadata` - The metadata key-pairs to be sent
61
+ /// * `operation` - The operation name for the binding to invoke.
60
62
pub async fn invoke_binding < S > (
61
63
& mut self ,
62
64
name : S ,
63
65
data : Vec < u8 > ,
66
+ metadata : Option < HashMap < String , String > > ,
67
+ operation : S ,
64
68
) -> Result < InvokeBindingResponse , Error >
65
69
where
66
70
S : Into < String > ,
@@ -69,11 +73,36 @@ impl<T: DaprInterface> Client<T> {
69
73
. invoke_binding ( InvokeBindingRequest {
70
74
name : name. into ( ) ,
71
75
data,
72
- ..Default :: default ( )
76
+ metadata : metadata. unwrap_or_default ( ) ,
77
+ operation : operation. into ( ) ,
73
78
} )
74
79
. await
75
80
}
76
81
82
+ /// Invoke a Dapr output binding without expecting a response.
83
+ ///
84
+ /// # Arguments
85
+ ///
86
+ /// * `name` - The name of the output binding to invoke.
87
+ /// * `operation` - The operation name for the binding to invoke.
88
+ pub async fn invoke_output_binding < S > ( & mut self , name : S , operation : S ) -> Result < ( ) , Error >
89
+ where
90
+ S : Into < String > ,
91
+ {
92
+ let result = self
93
+ . 0
94
+ . invoke_binding ( InvokeBindingRequest {
95
+ name : name. into ( ) ,
96
+ operation : operation. into ( ) ,
97
+ ..Default :: default ( )
98
+ } )
99
+ . await ;
100
+ match result {
101
+ Ok ( _) => Ok ( ( ) ) ,
102
+ Err ( _) => Err ( result. unwrap_err ( ) ) ,
103
+ }
104
+ }
105
+
77
106
/// Publish a payload to multiple consumers who are listening on a topic.
78
107
///
79
108
/// Dapr guarantees at least once semantics for this endpoint.
0 commit comments