Skip to content

devtools: ActorEncode trait#41139

Merged
jdm merged 1 commit intoservo:mainfrom
eerii:encode-actor
Dec 8, 2025
Merged

devtools: ActorEncode trait#41139
jdm merged 1 commit intoservo:mainfrom
eerii:encode-actor

Conversation

@eerii
Copy link
Copy Markdown
Member

@eerii eerii commented Dec 8, 2025

Unify various encodable and encode methods from actors in an ActorEncode trait, making it more consistent.

Add an ActorRegistry::encode method that finds an actor by name and then returns its serialized version.

Add an ActorMsg struct to avoid creating repeated structs for simple serializations.

There are two exceptions: EncodableConsoleMessage and NodeInfo. These also have an encode method, but they are not actors, so including them in this trait doesn't make much sense. Besides, they have special requirements so it is better to keep them separate.

Testing: Manual testing in about:debugging.

Unify various `encodable` and `encode` methods from actors in an
`ActorEncode` trait, making it more consistent.

Add an `ActorRegistry::encode` method that finds an actor by name and
then returns its serialized version.

Add an `ActorMsg` struct to avoid creating repeated structs for simple
serializations.

There are two exceptions for this, `EncodableConsoleMessage` and
`NodeInfo`. These also have an `encode` method, but they are not actors,
so including them in this trait doesn't make much sense. Besides, they
have special requirements so it is better to keep them separate.

Signed-off-by: eri <[email protected]>
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Dec 8, 2025
@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Dec 8, 2025
@jdm jdm added this pull request to the merge queue Dec 8, 2025
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Dec 8, 2025
Merged via the queue into servo:main with commit deb1724 Dec 8, 2025
32 checks passed
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Dec 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants