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

feat(zenoh_id): exposing into [u8; 16] & to_le_bytes() #1373

Merged
merged 2 commits into from
Sep 9, 2024

Conversation

DariusIMP
Copy link
Member

@DariusIMP DariusIMP commented Sep 6, 2024

Allowing users to create a ZenohId from a slice, using TryFrom, and also allowing users to convert a ZenohId into [u8; 16].

Related to eclipse-zenoh/zenoh-kotlin#196.

@DariusIMP DariusIMP requested a review from milyin September 6, 2024 16:16
Copy link

github-actions bot commented Sep 6, 2024

PR missing one of the required labels: {'new feature', 'bug', 'dependencies', 'enhancement', 'breaking-change', 'internal', 'documentation'}

@DariusIMP DariusIMP requested a review from Mallets September 6, 2024 16:17
@DariusIMP DariusIMP added the enhancement Existing things could work better label Sep 6, 2024
Allowing users to create a ZenohId from a slice, using TryFrom, and also
allowing users to convert a ZenohId into a [u8; 16].
@DariusIMP DariusIMP force-pushed the feat/zenohid/fromslice branch from 492e908 to 3c14ad1 Compare September 9, 2024 11:25
@@ -72,6 +81,13 @@ impl From<ZenohId> for OwnedKeyExpr {
}
}

impl From<ZenohId> for [u8; ZenohIdProto::MAX_SIZE] {
Copy link
Member

Choose a reason for hiding this comment

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

Instead of this From it would be better to expose to_le_bytes which provides stronger guarantees on the endianess.

@DariusIMP DariusIMP changed the title feat(zenoh_id): exposing into vec & try from slice feat(zenoh_id): exposing into [u8; 16] & try from slice Sep 9, 2024
@DariusIMP DariusIMP requested a review from Mallets September 9, 2024 13:42
@DariusIMP DariusIMP changed the title feat(zenoh_id): exposing into [u8; 16] & try from slice feat(zenoh_id): exposing into [u8; 16] & to_le_bytes() Sep 9, 2024
@Mallets Mallets merged commit f9260bb into eclipse-zenoh:main Sep 9, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Existing things could work better
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants