@@ -29,6 +29,7 @@ use crate::{
2929 pubsub:: { Publisher , Subscriber } ,
3030 qos:: { CongestionControl , Priority , Reliability } ,
3131 query:: { Querier , QueryConsolidation , QueryTarget , Queryable , Reply , Selector } ,
32+ sample:: Locality ,
3233 time:: Timestamp ,
3334 utils:: { duration, wait, IntoPython , MapInto } ,
3435} ;
@@ -86,7 +87,7 @@ impl Session {
8687 }
8788
8889 #[ allow( clippy:: too_many_arguments) ]
89- #[ pyo3( signature = ( key_expr, payload, * , encoding = None , congestion_control = None , priority = None , express = None , attachment = None ) ) ]
90+ #[ pyo3( signature = ( key_expr, payload, * , encoding = None , congestion_control = None , priority = None , express = None , attachment = None , timestamp = None , allowed_destination = None ) ) ]
9091 fn put (
9192 & self ,
9293 py : Python ,
@@ -97,6 +98,8 @@ impl Session {
9798 priority : Option < Priority > ,
9899 express : Option < bool > ,
99100 #[ pyo3( from_py_with = "ZBytes::from_py_opt" ) ] attachment : Option < ZBytes > ,
101+ timestamp : Option < Timestamp > ,
102+ allowed_destination : Option < Locality > ,
100103 ) -> PyResult < ( ) > {
101104 let build = build ! (
102105 self . 0 . put( key_expr, payload) ,
@@ -105,11 +108,14 @@ impl Session {
105108 priority,
106109 express,
107110 attachment,
111+ timestamp,
112+ allowed_destination,
108113 ) ;
109114 wait ( py, build)
110115 }
111116
112- #[ pyo3( signature = ( key_expr, * , congestion_control = None , priority = None , express = None , attachment = None ) ) ]
117+ #[ allow( clippy:: too_many_arguments) ]
118+ #[ pyo3( signature = ( key_expr, * , congestion_control = None , priority = None , express = None , attachment = None , timestamp = None , allowed_destination = None ) ) ]
113119 fn delete (
114120 & self ,
115121 py : Python ,
@@ -118,19 +124,23 @@ impl Session {
118124 priority : Option < Priority > ,
119125 express : Option < bool > ,
120126 #[ pyo3( from_py_with = "ZBytes::from_py_opt" ) ] attachment : Option < ZBytes > ,
127+ timestamp : Option < Timestamp > ,
128+ allowed_destination : Option < Locality > ,
121129 ) -> PyResult < ( ) > {
122130 let build = build ! (
123131 self . 0 . delete( key_expr) ,
124132 congestion_control,
125133 priority,
126134 express,
127135 attachment,
136+ timestamp,
137+ allowed_destination,
128138 ) ;
129139 wait ( py, build)
130140 }
131141
132142 #[ allow( clippy:: too_many_arguments) ]
133- #[ pyo3( signature = ( selector, handler = None , * , target = None , consolidation = None , timeout = None , congestion_control = None , priority = None , express = None , payload = None , encoding = None , attachment = None ) ) ]
143+ #[ pyo3( signature = ( selector, handler = None , * , target = None , consolidation = None , timeout = None , congestion_control = None , priority = None , express = None , payload = None , encoding = None , attachment = None , allowed_destination = None ) ) ]
134144 fn get (
135145 & self ,
136146 py : Python ,
@@ -147,6 +157,7 @@ impl Session {
147157 #[ pyo3( from_py_with = "ZBytes::from_py_opt" ) ] payload : Option < ZBytes > ,
148158 #[ pyo3( from_py_with = "Encoding::from_py_opt" ) ] encoding : Option < Encoding > ,
149159 #[ pyo3( from_py_with = "ZBytes::from_py_opt" ) ] attachment : Option < ZBytes > ,
160+ allowed_destination : Option < Locality > ,
150161 ) -> PyResult < HandlerImpl < Reply > > {
151162 let ( handler, _) = into_handler ( py, handler) ?;
152163 let builder = build ! (
@@ -160,6 +171,7 @@ impl Session {
160171 payload,
161172 encoding,
162173 attachment,
174+ allowed_destination,
163175 ) ;
164176 wait ( py, builder. with ( handler) ) . map_into ( )
165177 }
@@ -169,32 +181,34 @@ impl Session {
169181 self . 0 . info ( ) . into ( )
170182 }
171183
172- #[ pyo3( signature = ( key_expr, handler = None ) ) ]
184+ #[ pyo3( signature = ( key_expr, handler = None , * , allowed_origin = None ) ) ]
173185 fn declare_subscriber (
174186 & self ,
175187 py : Python ,
176188 #[ pyo3( from_py_with = "KeyExpr::from_py" ) ] key_expr : KeyExpr ,
177189 handler : Option < & Bound < PyAny > > ,
190+ allowed_origin : Option < Locality > ,
178191 ) -> PyResult < Subscriber > {
179192 let ( handler, background) = into_handler ( py, handler) ?;
180- let builder = self . 0 . declare_subscriber ( key_expr) ;
193+ let builder = build ! ( self . 0 . declare_subscriber( key_expr) , allowed_origin ) ;
181194 let mut subscriber = wait ( py, builder. with ( handler) ) ?;
182195 if background {
183196 subscriber. set_background ( true ) ;
184197 }
185198 Ok ( subscriber. into ( ) )
186199 }
187200
188- #[ pyo3( signature = ( key_expr, handler = None , * , complete = None ) ) ]
201+ #[ pyo3( signature = ( key_expr, handler = None , * , complete = None , allowed_origin = None ) ) ]
189202 fn declare_queryable (
190203 & self ,
191204 py : Python ,
192205 #[ pyo3( from_py_with = "KeyExpr::from_py" ) ] key_expr : KeyExpr ,
193206 handler : Option < & Bound < PyAny > > ,
194207 complete : Option < bool > ,
208+ allowed_origin : Option < Locality > ,
195209 ) -> PyResult < Queryable > {
196210 let ( handler, background) = into_handler ( py, handler) ?;
197- let builder = build ! ( self . 0 . declare_queryable( key_expr) , complete) ;
211+ let builder = build ! ( self . 0 . declare_queryable( key_expr) , complete, allowed_origin ) ;
198212 let mut queryable = wait ( py, builder. with ( handler) ) ?;
199213 if background {
200214 queryable. set_background ( true ) ;
@@ -203,7 +217,7 @@ impl Session {
203217 }
204218
205219 #[ allow( clippy:: too_many_arguments) ]
206- #[ pyo3( signature = ( key_expr, * , encoding = None , congestion_control = None , priority = None , express = None , reliability = None ) ) ]
220+ #[ pyo3( signature = ( key_expr, * , encoding = None , congestion_control = None , priority = None , express = None , reliability = None , allowed_destination = None ) ) ]
207221 fn declare_publisher (
208222 & self ,
209223 py : Python ,
@@ -213,6 +227,7 @@ impl Session {
213227 priority : Option < Priority > ,
214228 express : Option < bool > ,
215229 reliability : Option < Reliability > ,
230+ allowed_destination : Option < Locality > ,
216231 ) -> PyResult < Publisher > {
217232 let builder = build ! (
218233 self . 0 . declare_publisher( key_expr) ,
@@ -221,12 +236,13 @@ impl Session {
221236 priority,
222237 express,
223238 reliability,
239+ allowed_destination,
224240 ) ;
225241 wait ( py, builder) . map_into ( )
226242 }
227243
228244 #[ allow( clippy:: too_many_arguments) ]
229- #[ pyo3( signature = ( key_expr, * , target = None , consolidation = None , timeout = None , congestion_control = None , priority = None , express = None ) ) ]
245+ #[ pyo3( signature = ( key_expr, * , target = None , consolidation = None , timeout = None , congestion_control = None , priority = None , express = None , allowed_destination = None ) ) ]
230246 fn declare_querier (
231247 & self ,
232248 py : Python ,
@@ -239,6 +255,7 @@ impl Session {
239255 congestion_control : Option < CongestionControl > ,
240256 priority : Option < Priority > ,
241257 express : Option < bool > ,
258+ allowed_destination : Option < Locality > ,
242259 ) -> PyResult < Querier > {
243260 let builder = build ! (
244261 self . 0 . declare_querier( key_expr) ,
@@ -248,6 +265,7 @@ impl Session {
248265 congestion_control,
249266 priority,
250267 express,
268+ allowed_destination,
251269 ) ;
252270 wait ( py, builder) . map_into ( )
253271 }
0 commit comments