comparison rust/hg-cpython/src/ref_sharing.rs @ 42889:ea91a126c803

rust-cpython: rename py_shared_iterator_impl to py_shared_iterator It's a public interface now.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 08 Sep 2019 12:26:12 +0900
parents 67853749961b
children 74d67c645278
comparison
equal deleted inserted replaced
42888:67853749961b 42889:ea91a126c803
191 /// * `$inner_struct` is the identifier of the underlying Rust struct 191 /// * `$inner_struct` is the identifier of the underlying Rust struct
192 /// * `$data_member` is the identifier of the data member of `$inner_struct` 192 /// * `$data_member` is the identifier of the data member of `$inner_struct`
193 /// that will be shared. 193 /// that will be shared.
194 /// * `$leaked` is the identifier to give to the struct that will manage 194 /// * `$leaked` is the identifier to give to the struct that will manage
195 /// references to `$name`, to be used for example in other macros like 195 /// references to `$name`, to be used for example in other macros like
196 /// `py_shared_iterator_impl`. 196 /// `py_shared_iterator`.
197 /// 197 ///
198 /// # Example 198 /// # Example
199 /// 199 ///
200 /// ``` 200 /// ```
201 /// struct MyStruct { 201 /// struct MyStruct {
330 /// } 330 /// }
331 /// } 331 /// }
332 /// 332 ///
333 /// py_shared_ref!(MyType, MyStruct, inner, MyTypeLeakedRef); 333 /// py_shared_ref!(MyType, MyStruct, inner, MyTypeLeakedRef);
334 /// 334 ///
335 /// py_shared_iterator_impl!( 335 /// py_shared_iterator!(
336 /// MyTypeItemsIterator, 336 /// MyTypeItemsIterator,
337 /// MyTypeLeakedRef, 337 /// MyTypeLeakedRef,
338 /// HashMap<'static, Vec<u8>, Vec<u8>>, 338 /// HashMap<'static, Vec<u8>, Vec<u8>>,
339 /// MyType::translate_key_value, 339 /// MyType::translate_key_value,
340 /// Option<(PyBytes, PyBytes)> 340 /// Option<(PyBytes, PyBytes)>
341 /// ); 341 /// );
342 /// ``` 342 /// ```
343 macro_rules! py_shared_iterator_impl { 343 macro_rules! py_shared_iterator {
344 ( 344 (
345 $name: ident, 345 $name: ident,
346 $leaked: ident, 346 $leaked: ident,
347 $iterator_type: ty, 347 $iterator_type: ty,
348 $success_func: expr, 348 $success_func: expr,