-
Notifications
You must be signed in to change notification settings - Fork 185
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 all missing properties FFI APIs #6177
Conversation
They can be re-renamed when unicode-org#6067 is fixed, if desired.
5b066a8
to
b117bb3
Compare
b117bb3
to
a00721b
Compare
a00721b
to
51b16d4
Compare
51b16d4
to
9515892
Compare
} | ||
#[diplomat::rust_link(icu::properties::props::BidiClass::to_icu4c_value, FnInStruct)] | ||
/// Convert to an integer value usable with ICU4C and CodePointMapData | ||
pub fn to_integer_value(self) -> u8 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we use the same names?
pub fn to_integer_value(self) -> u8 { | |
pub fn to_icu4c_value(self) -> u8 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I explained why in the PR body:
I am not renaming them to have icu4c in their name because in the context of ICU4X FFI the property integers are not just useful for ICU4X: they're useful for CodePointMapData (which does not return typed values)
pub fn from_integer(other: u8) -> Option<Self> { | ||
#[diplomat::rust_link(icu::properties::props::BidiClass::from_icu4c_value, FnInStruct)] | ||
/// Convert from an integer value from ICU4C or CodePointMapData | ||
pub fn from_integer_value(other: u8) -> Option<Self> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pub fn from_integer_value(other: u8) -> Option<Self> { | |
pub fn from_icu4c_value(other: u8) -> Option<Self> { |
Hm, we're going to have a bit of a conflicty time with all these FFI PRs. Oh well. |
Part of #6169
Adds:
rust_link
for to/from ICU4X APIs. Rename them a bit. I am not renaming them to have icu4c in their name because in the context of ICU4X FFI the property integers are not just useful for ICU4X: they're useful for CodePointMapData (which does not return typed values)for_char
convenience APIs over FFI, providing a no-alloc way to get propertieslong_name
andshort_name
APIs, only in compiled data mode. We can add a separate data loading path if requested