Skip to content

Conversation

@mkrasnitski
Copy link
Collaborator

@mkrasnitski mkrasnitski commented Feb 16, 2025

Followup to #3114.

By using an intermediate untagged enum with an Unknown variant, we can process sequence numbers for unknown events without cloning the json payload.

@github-actions github-actions bot added model Related to the `model` module. gateway Related to the `gateway` module. labels Feb 16, 2025
@GnomedDev
Copy link
Member

GnomedDev commented Feb 16, 2025

@mkrasnitski You can probably solve the typesize error using typesize(with = "") and providing a function with the signature fn(Box<str>) -> usize returning str::len.

@mkrasnitski mkrasnitski added the breaking change The public API is changed, resulting in miscompilations or unexpected new behaviour for users label Feb 18, 2025
By using an intermediate untagged enum with an `Unknown` variant, we can
process sequence numbers for unknown events without cloning the json
payload in the hot path.
Also, deserialize directly rather than calling `serde_json::from_str`.
@mkrasnitski mkrasnitski force-pushed the gateway-deserialization branch from bd7ddfb to 71c4296 Compare March 7, 2025 21:02
@arqunis arqunis merged commit 64617d7 into serenity-rs:next Mar 8, 2025
24 checks passed
mkrasnitski added a commit to mkrasnitski/serenity that referenced this pull request Mar 10, 2025
Followup to serenity-rs#3114.

By using an intermediate untagged enum with an `Unknown` variant, we can
process sequence numbers for unknown events without cloning the json
payload.
mkrasnitski added a commit to mkrasnitski/serenity that referenced this pull request Mar 11, 2025
Followup to serenity-rs#3114.

By using an intermediate untagged enum with an `Unknown` variant, we can
process sequence numbers for unknown events without cloning the json
payload.
@mkrasnitski mkrasnitski deleted the gateway-deserialization branch March 11, 2025 23:49
GnomedDev pushed a commit to GnomedDev/serenity that referenced this pull request Mar 26, 2025
Followup to serenity-rs#3114.

By using an intermediate untagged enum with an `Unknown` variant, we can
process sequence numbers for unknown events without cloning the json
payload.
GnomedDev pushed a commit to GnomedDev/serenity that referenced this pull request Mar 26, 2025
Followup to serenity-rs#3114.

By using an intermediate untagged enum with an `Unknown` variant, we can
process sequence numbers for unknown events without cloning the json
payload.
GnomedDev pushed a commit that referenced this pull request Apr 28, 2025
Followup to #3114.

By using an intermediate untagged enum with an `Unknown` variant, we can
process sequence numbers for unknown events without cloning the json
payload.
GnomedDev pushed a commit that referenced this pull request May 19, 2025
Followup to #3114.

By using an intermediate untagged enum with an `Unknown` variant, we can
process sequence numbers for unknown events without cloning the json
payload.
mkrasnitski added a commit to mkrasnitski/serenity that referenced this pull request Jun 30, 2025
Followup to serenity-rs#3114.

By using an intermediate untagged enum with an `Unknown` variant, we can
process sequence numbers for unknown events without cloning the json
payload.
mkrasnitski added a commit to mkrasnitski/serenity that referenced this pull request Jun 30, 2025
Followup to serenity-rs#3114.

By using an intermediate untagged enum with an `Unknown` variant, we can
process sequence numbers for unknown events without cloning the json
payload.
mkrasnitski added a commit to mkrasnitski/serenity that referenced this pull request Jun 30, 2025
Followup to serenity-rs#3114.

By using an intermediate untagged enum with an `Unknown` variant, we can
process sequence numbers for unknown events without cloning the json
payload.
mkrasnitski added a commit to mkrasnitski/serenity that referenced this pull request Jul 28, 2025
Followup to serenity-rs#3114.

By using an intermediate untagged enum with an `Unknown` variant, we can
process sequence numbers for unknown events without cloning the json
payload.
mkrasnitski added a commit to mkrasnitski/serenity that referenced this pull request Jul 28, 2025
Followup to serenity-rs#3114.

By using an intermediate untagged enum with an `Unknown` variant, we can
process sequence numbers for unknown events without cloning the json
payload.
mkrasnitski added a commit to mkrasnitski/serenity that referenced this pull request Oct 7, 2025
Followup to serenity-rs#3114.

By using an intermediate untagged enum with an `Unknown` variant, we can
process sequence numbers for unknown events without cloning the json
payload.
mkrasnitski added a commit to mkrasnitski/serenity that referenced this pull request Oct 7, 2025
Followup to serenity-rs#3114.

By using an intermediate untagged enum with an `Unknown` variant, we can
process sequence numbers for unknown events without cloning the json
payload.
mkrasnitski added a commit to mkrasnitski/serenity that referenced this pull request Oct 7, 2025
Followup to serenity-rs#3114.

By using an intermediate untagged enum with an `Unknown` variant, we can
process sequence numbers for unknown events without cloning the json
payload.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change The public API is changed, resulting in miscompilations or unexpected new behaviour for users gateway Related to the `gateway` module. model Related to the `model` module.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants