-
-
Notifications
You must be signed in to change notification settings - Fork 85
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
🔥 message mod API improvements #439
Commits on Aug 14, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 314e948 - Browse repository at this point
Copy the full SHA 314e948View commit details -
🔥 zb: Drop message::Field::Invalid
This variant is never constructed by us. When we encounter invalid field code, we throw an error.
Configuration menu - View commit details
-
Copy full SHA for 2ef0d55 - Browse repository at this point
Copy the full SHA 2ef0d55View commit details
Commits on Aug 15, 2023
-
🔥 zb: Drop unneeded From<u8> for message::FieldCode
Seriously doubt anyone uses this and this will also allow us to drop `FieldCode::Invalid` in the following commit.
Configuration menu - View commit details
-
Copy full SHA for 546f061 - Browse repository at this point
Copy the full SHA 546f061View commit details -
🔥 zb: Drop now unneeded message::FieldCode::Invalid
A message with an invalid field code will just fail to deserialize so we don't need to represent this state.
Configuration menu - View commit details
-
Copy full SHA for 53cda6c - Browse repository at this point
Copy the full SHA 53cda6cView commit details -
🔥 zb: Drop unneeded From<u8> for message::Type
Seriously doubt anyone uses this and this will also allow us to drop `message::Type::Invalid` in the following commit.
Configuration menu - View commit details
-
Copy full SHA for 4c91b4e - Browse repository at this point
Copy the full SHA 4c91b4eView commit details -
🔥 zb: Drop now unneeded message::Type::Invalid
An invalid message will just fail to deserialize so we don't need to represent this state.
Configuration menu - View commit details
-
Copy full SHA for fb7c2a1 - Browse repository at this point
Copy the full SHA fb7c2a1View commit details -
🏗️ zb: Cache all message header fields
We'll be using these to avoid having to deserialize header and individual fields repeatedly.
Configuration menu - View commit details
-
Copy full SHA for 793e4df - Browse repository at this point
Copy the full SHA 793e4dfView commit details -
♻️ zb: Message::body_signature now infallible and more efficient
As it is now based on the internal fields cache and doesn't involve deserializing the header.
Configuration menu - View commit details
-
Copy full SHA for 6d318a7 - Browse repository at this point
Copy the full SHA 6d318a7View commit details -
⚡️ zb: Message::header doesn't deserialize anymore
We now construct the Header from fields cache and primary header clone.
Configuration menu - View commit details
-
Copy full SHA for 8c45ee0 - Browse repository at this point
Copy the full SHA 8c45ee0View commit details -
🔥 zb: Drop Error::NoBodySignature variant
This variant is never constructed anymore and hence useless. We could just deprecate it only but the chances of someone using this in client code are very low so let's not bother.
Configuration menu - View commit details
-
Copy full SHA for e42584c - Browse repository at this point
Copy the full SHA e42584cView commit details -
⚡️ zb: Message::fields doesn't deserialize anymore
We now construct the fields from the cache.
Configuration menu - View commit details
-
Copy full SHA for 510f3d3 - Browse repository at this point
Copy the full SHA 510f3d3View commit details -
📝 zb: Update docs about Message::{header, fields} being slow
They are not anymore.
Configuration menu - View commit details
-
Copy full SHA for 539cab4 - Browse repository at this point
Copy the full SHA 539cab4View commit details -
🔥 zb: Message::fields now infallible
Since we construct the fields from the cache.
Configuration menu - View commit details
-
Copy full SHA for 7fb2d50 - Browse repository at this point
Copy the full SHA 7fb2d50View commit details -
🔥 zb: Message::header now infallible
Since we construct the header from the cache now.
Configuration menu - View commit details
-
Copy full SHA for 8aaca42 - Browse repository at this point
Copy the full SHA 8aaca42View commit details -
🔥 zb: message::Header getters now infallible
Since we either construct the header from the cache now or deserialize from raw bytes and the deserialization will fail if the message has fields with incorrect codes (the only possible issue here).
Configuration menu - View commit details
-
Copy full SHA for fb88092 - Browse repository at this point
Copy the full SHA fb88092View commit details -
🔥 zb: Drop all use of direct field getters of Message
They'll be deprecated in a following commit.
Configuration menu - View commit details
-
Copy full SHA for bf17866 - Browse repository at this point
Copy the full SHA bf17866View commit details -
🗑️ zb: Deprecate direct fields gettes of Message
Not only is the performance of the direct fields getters no longer much worse than the getting the fields through the header, but also field getters on the header are much faster the that of Message. Moreover, I've ideas on how to make the header getter even faster.
Configuration menu - View commit details
-
Copy full SHA for 260db58 - Browse repository at this point
Copy the full SHA 260db58View commit details -
🔥 zb: Drop message::Header::new() from public API
I don't see users having much need for this and we're about to make `Field*` API private.
Configuration menu - View commit details
-
Copy full SHA for 303cfdc - Browse repository at this point
Copy the full SHA 303cfdcView commit details -
🔥 zb: Drop message::Fields::into_field
We don't need this method internally, doubt anyone uses it and we're about to turn Field* API private anyway.
Configuration menu - View commit details
-
Copy full SHA for 6d27d1e - Browse repository at this point
Copy the full SHA 6d27d1eView commit details -
🔥 zb: Drop message::Header::into_fields
We don't need this method internally, doubt anyone uses it and we're about to turn Field* API private anyway.
Configuration menu - View commit details
-
Copy full SHA for 8b1376b - Browse repository at this point
Copy the full SHA 8b1376bView commit details -
🔥 zb: message::Field* API now private
This exposes way too much internal details about the protocol that users do not need. The specific field getters we provide are sufficient for any low-level code. I wrote most of this when I was still very new to Rust and I started with a very bottoms-up approach. Hence we these API had been public until now. I doubt anyone uses these anyway so chances of people's code breaking are low but even if they do, it's a API breaking release.
Configuration menu - View commit details
-
Copy full SHA for 8db83bd - Browse repository at this point
Copy the full SHA 8db83bdView commit details