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

Revised Encoding API and wire format #764

Merged
merged 42 commits into from
Mar 12, 2024
Merged

Revised Encoding API and wire format #764

merged 42 commits into from
Mar 12, 2024

Conversation

Mallets
Copy link
Member

@Mallets Mallets commented Feb 26, 2024

Reviewed Encoding API and wire format:

  • Encoding ID resolution is changed from 8bit to 16bit.
  • A bit in the encoding prefix is used to indicate the presence of a suffix. Encoding/decoding of prefix happens as 32bit to account for the bitflag. Encoding ID stays 16bit.
  • Define a set of constants for common encodings.
  • Encodings can be parsed from a string and displayed as string.
  • Define a pre-defined and internal mapping of known encoding to compact wire representation.
  • Provide encoding::auto for automatic encoding selection based on the information from the type system. This feature will be provided via a different PR. Enable auto filling of encoding based on type information #812.

* Encoding contains a mapping

* Add forgotten file

* Provide default encoder

* Refine encoder

* Fix encoding codec

* Do not change the protocol representation

* Accept Cow<'static, str> in EncodingMapping trait

* Improve Value::Display

* Fix doctests

* Bump EncodingPrefix to u16. Add IANA encoding mapping.

* Improve doc

* Remove generic from Encoding::starts_with

* Remove Display impl for Encoding

* Improve doc

* Improve doc

* Improve encoding parsing

* Improve comments

* Improve doc

* Encoding suffix bitflag

* Encoder/Decoder traits take self

* Rename encoding() to with_encoding()

* Make Value, ZBuf, SingleOrVec empty() const

* Derive Encoder for &mut u* and i*

* Integers are encoded as le_bytes are not as string

* Integers are encoded as le_bytes are not as string

* Fix doctest
@eclipse-zenoh-bot
Copy link
Contributor

@Mallets If this pull request contains a bugfix or a new feature, then please consider using Closes #ISSUE-NUMBER syntax to link it to an issue.

@Mallets Mallets requested a review from milyin March 8, 2024 13:51
Copy link
Contributor

@milyin milyin left a comment

Choose a reason for hiding this comment

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

Looks good for me

@eclipse-zenoh-bot
Copy link
Contributor

@Mallets If this pull request contains a bugfix or a new feature, then please consider using Closes #ISSUE-NUMBER syntax to link it to an issue.

@Mallets Mallets requested a review from milyin March 11, 2024 14:20
@milyin milyin mentioned this pull request Mar 11, 2024
@milyin milyin linked an issue Mar 11, 2024 that may be closed by this pull request
@Mallets Mallets merged commit a8cdbbe into protocol_changes Mar 12, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

Encoding API rework
3 participants