Skip to content

Add new FromGlibPtrBorrow2 and FromGlibPtrBorrowMut2 traits #1788

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sdroege
Copy link
Member

@sdroege sdroege commented Aug 12, 2025

These borrow more safely the underlying type and are supposed to replace the old FromGlibPtrBorrow trait once all users are gone, as well as the manual implementations for the trait functions which are deprecated now.

@sdroege sdroege requested a review from bilelmoussaoui August 12, 2025 15:18
///
/// For more information, refer to module level documentation.
// FIXME: Rename to FromGlibPtrBorrow once all users are gone
pub trait FromGlibPtrBorrow2<P>: Sized {
Copy link
Member Author

@sdroege sdroege Aug 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should also implement this for &str, &GStr, &GStrPtr, &StrVRef and various other types. Also boxed derive etc.

These borrow more safely the underlying type and are supposed to replace
the old FromGlibPtrBorrow trait once all users are gone, as well as the
manual implementations for the trait functions which are deprecated now.
@sdroege sdroege force-pushed the from-glib-borrow-2 branch from 669a3da to d9c876d Compare August 12, 2025 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant