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 a safe API for user data #257

Merged
merged 3 commits into from May 13, 2019

Conversation

Projects
None yet
3 participants
@SimonSapin
Copy link
Contributor

commented May 12, 2019

No description provided.

@SimonSapin

This comment has been minimized.

Copy link
Contributor Author

commented May 12, 2019

Should doc-comments go into https://github.com/gtk-rs/lgpl-docs? Are docs written specifically for Rust bindings also under the LGPL?

@GuillaumeGomez

This comment has been minimized.

Copy link
Member

commented May 12, 2019

If the doc comments come from somewhere under LGPL, then LGPL, otherwise it's MIT and you can leave them where they are.

if let Ok(surface) = &result {
static IMAGE_SURFACE_DATA: crate::UserDataKey<Box<dyn AsMut<[u8]>>> =
crate::UserDataKey::new();
surface.set_user_data(&IMAGE_SURFACE_DATA, Rc::new(data))

This comment has been minimized.

Copy link
@sdroege

sdroege May 13, 2019

Member

Why does this have to be in an Rc?

This comment has been minimized.

Copy link
@sdroege

sdroege May 13, 2019

Member

Oh I see, because of the getter

@sdroege

This comment has been minimized.

Copy link
Member

commented May 13, 2019

👍

@GuillaumeGomez

This comment has been minimized.

Copy link
Member

commented May 13, 2019

Thanks @SimonSapin (especially for the documentation!)!

@GuillaumeGomez GuillaumeGomez merged commit bc8d33d into gtk-rs:master May 13, 2019

1 of 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build failed
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.