Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PyCapsule API #1980

Merged
merged 36 commits into from Nov 23, 2021
Merged
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
e0219b4
Add PyCapsule API
milesgranger Nov 9, 2021
ed21e8c
Docs and small cleanup
milesgranger Nov 12, 2021
a7ca02d
Add T: 'static and vec tests for context and storage
milesgranger Nov 13, 2021
295b611
Update func test to use Py<PyCapsule>, still pass
milesgranger Nov 13, 2021
12edeff
Make PyCapsule::import unsafe
milesgranger Nov 18, 2021
b16ec0b
Make PyCapsule::get_context unsafe
milesgranger Nov 18, 2021
83f74bb
Fix typo in destructor
milesgranger Nov 18, 2021
74e570f
Refactor PyCapsule::new/new_with_destructor
milesgranger Nov 18, 2021
1318cec
Refactor destructor API [skip ci]
milesgranger Nov 18, 2021
2f9a754
Fix docs regarding safety
milesgranger Nov 19, 2021
894109f
Remove PyCapsule::get_destructor
milesgranger Nov 19, 2021
9540679
Fix typo bitwise operator [skip ci]
milesgranger Nov 19, 2021
06ae71b
Fix clippy
milesgranger Nov 19, 2021
c0c195d
Fixup: fix doc test fail
milesgranger Nov 19, 2021
e0f5a0c
Add changlog entry and address pr comments
milesgranger Nov 20, 2021
c9b8337
Remove noblock option and add grammatical doc updates
milesgranger Nov 20, 2021
0bd03de
Trying to figure out passing functions with T: Send [skip ci]
milesgranger Nov 20, 2021
6072403
Cleanup and add back casting of function value to PyCapsule
milesgranger Nov 21, 2021
30a4e8f
Change destructor to FnOnce(T, *mut c_void) to handle potential context
milesgranger Nov 21, 2021
f0cf17f
Assert capsule value size > 0
milesgranger Nov 21, 2021
374bbe9
Resolve CHANGELOG.md conflict
milesgranger Nov 21, 2021
5c0a22b
Fixup: doc test fail fix
milesgranger Nov 21, 2021
f9fe840
Fix merge mistake
milesgranger Nov 21, 2021
9d83940
Add destructor test and docs
milesgranger Nov 21, 2021
934e61b
fixup
milesgranger Nov 21, 2021
c13bbc9
Fix docs
milesgranger Nov 21, 2021
7a87a15
Fail to compile when zero sized type is used in PyCapsule value [skip…
milesgranger Nov 21, 2021
73ad0d1
Fixup: doc fix for PanicWhenZeroSized [skip ci]
milesgranger Nov 21, 2021
e435284
Make context always *mut void w/ examples
milesgranger Nov 21, 2021
d0c623d
Fix clippy and docs
milesgranger Nov 21, 2021
1962a65
Address PR comments (docs & zero size check refactor) [skip ci]
milesgranger Nov 21, 2021
ba3f15e
Hide docs for AssertNotZeroSized trait [skip ci]
milesgranger Nov 21, 2021
3662a49
Remove unsafe from PyCapsule::set_context (ignore clippy warning)
milesgranger Nov 21, 2021
14a3c09
Remove safety docs from PyCapsule::set_context
milesgranger Nov 21, 2021
4f2c9b8
Rename PyCapsule::get_pointer -> PyCapsule::pointer
milesgranger Nov 22, 2021
f904acf
capsule: rename to types/capsule
birkenfeld Nov 22, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

- Add `Py::setattr` method. [#2009](https://github.com/PyO3/pyo3/pull/2009)
- Add `PyCapsule`, exposing the [Capsule API](https://docs.python.org/3/c-api/capsule.html#capsules). [#1980](https://github.com/PyO3/pyo3/pull/1980)

### Changed

Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Expand Up @@ -334,6 +334,7 @@ pub mod marshal;
pub mod once_cell;
pub mod panic;
pub mod prelude;
pub mod pycapsule;
pub mod pycell;
pub mod pyclass;
pub mod pyclass_init;
Expand Down