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

Implement AnyValue, a wrapper around std::any::Any #252

Merged
merged 4 commits into from Nov 15, 2017

Conversation

Projects
None yet
3 participants
@sdroege
Member

sdroege commented Nov 13, 2017

This allows to store any Rust type (that is 'static, Clone, Send, Sync,
Any) to be stored in GValues and passed around as GValues through C
code, while being able to take out the original values in Rust again.

Fixes #251

Let me know if this looks good to you, then I add documentation and especially a code example to the documentation. Test is included to prove that it actually works as expected.

@GuillaumeGomez

This comment has been minimized.

Show comment
Hide comment
@GuillaumeGomez
Member

GuillaumeGomez commented Nov 13, 2017

👍

Show outdated Hide outdated src/value.rs Outdated
@EPashkin

This comment has been minimized.

Show comment
Hide comment
@EPashkin
Member

EPashkin commented Nov 13, 2017

@sdroege Thanks

@sdroege

This comment has been minimized.

Show comment
Hide comment
@sdroege

sdroege Nov 13, 2017

Member

I'll first fix #253, and then this here will get a SendAnyValue and AnyValue

Member

sdroege commented Nov 13, 2017

I'll first fix #253, and then this here will get a SendAnyValue and AnyValue

@sdroege

This comment has been minimized.

Show comment
Hide comment
@sdroege

sdroege Nov 15, 2017

Member

Done now, this should be merged after #255 and #256

Member

sdroege commented Nov 15, 2017

Done now, this should be merged after #255 and #256

@EPashkin

This comment has been minimized.

Show comment
Hide comment
@EPashkin

EPashkin Nov 15, 2017

Member

@sdroege Thanks again
👍

Member

EPashkin commented Nov 15, 2017

@sdroege Thanks again
👍

@GuillaumeGomez

This comment has been minimized.

Show comment
Hide comment
@GuillaumeGomez

GuillaumeGomez Nov 15, 2017

Member

Conflict.

Member

GuillaumeGomez commented Nov 15, 2017

Conflict.

Implement AnyValue, a wrapper around std::any::Any
This allows to store any Rust type (that is 'static, Clone, Send, Sync,
Any) to be stored in GValues and passed around as GValues through C
code, while being able to take out the original values in Rust again.

Fixes #251
@sdroege

This comment has been minimized.

Show comment
Hide comment
@sdroege

sdroege Nov 15, 2017

Member

Fixed :)

Member

sdroege commented Nov 15, 2017

Fixed :)

@EPashkin

This comment has been minimized.

Show comment
Hide comment
@EPashkin

EPashkin Nov 15, 2017

Member

@sdroege can you add TODO here? #256 (comment)

Member

EPashkin commented Nov 15, 2017

@sdroege can you add TODO here? #256 (comment)

sdroege added some commits Nov 15, 2017

Implement ToGlibPtrMut on SendValue and TypedValue<T>
We don't get this for free anymore because DerefMut is not implemented
anymore.
@sdroege

This comment has been minimized.

Show comment
Hide comment
@sdroege

sdroege Nov 15, 2017

Member

Done, and another little commit that helps usage of the new types

Member

sdroege commented Nov 15, 2017

Done, and another little commit that helps usage of the new types

@sdroege

This comment has been minimized.

Show comment
Hide comment
@sdroege

sdroege Nov 15, 2017

Member

All good to go?

Member

sdroege commented Nov 15, 2017

All good to go?

@GuillaumeGomez

This comment has been minimized.

Show comment
Hide comment
@GuillaumeGomez

GuillaumeGomez Nov 15, 2017

Member

It was for me before all these adds so waiting for @EPashkin's confirmation.

Member

GuillaumeGomez commented Nov 15, 2017

It was for me before all these adds so waiting for @EPashkin's confirmation.

@EPashkin

This comment has been minimized.

Show comment
Hide comment
@EPashkin

EPashkin Nov 15, 2017

Member

@sdroege Third thanks ;)
Still 👍

Member

EPashkin commented Nov 15, 2017

@sdroege Third thanks ;)
Still 👍

@GuillaumeGomez

This comment has been minimized.

Show comment
Hide comment
@GuillaumeGomez

GuillaumeGomez Nov 15, 2017

Member

Thanks! :)

Member

GuillaumeGomez commented Nov 15, 2017

Thanks! :)

@GuillaumeGomez GuillaumeGomez merged commit 96547dc into gtk-rs:master Nov 15, 2017

1 of 2 checks passed

continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment