Skip to content
New issue

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

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

Already on GitHub? # to your account

Allow access to internal C FuriString #127

Merged
merged 3 commits into from
Jan 23, 2024
Merged

Allow access to internal C FuriString #127

merged 3 commits into from
Jan 23, 2024

Conversation

dcoles
Copy link
Collaborator

@dcoles dcoles commented Jan 23, 2024

This is required as there are certain APIs that are not accessible through safe Rust bindings (e.g. furi_string_printf is variadic).

Both functions are safe because you can't use it to perform any unsafe operations without making an unsafe action such as dereferencing or passing to a C function.

This is needed as there are certain APIs that are not accessible
through the Rust bindings (e.g. `furi_string_printf`).

This function is safe because just holding a pointer is OK as you can't
use it to perform any unsafe operations without making an unsafe action
such as dereferencing or passing to a C function.
This allows consuming and taking ownership of the internal `sys::FuriString`
pointer for the purposes of C APIs that take ownership of a string.
@dcoles dcoles requested review from str4d and JarvisCraft January 23, 2024 03:23
@dcoles dcoles self-assigned this Jan 23, 2024
@dcoles dcoles merged commit 083b2c5 into main Jan 23, 2024
9 checks passed
@dcoles dcoles deleted the furistring-raw branch January 23, 2024 16:25
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants