Skip to content

change Service::run to take self: Box<Self>#5

Merged
mcharytoniuk merged 1 commit into
mainfrom
service-run-consume-self
May 22, 2026
Merged

change Service::run to take self: Box<Self>#5
mcharytoniuk merged 1 commit into
mainfrom
service-run-consume-self

Conversation

@mcharytoniuk
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Service trait so run consumes the service as self: Box<Self>, aligning the runtime to own each service for the duration of its execution (and enabling object-safe consumption via Box<dyn Service>).

Changes:

  • Changed Service::run signature from &mut self to self: Box<Self> and updated the runtime call path accordingly.
  • Updated all tests and the README example to match the new Service::run signature.
  • Bumped crate version to 0.3.0 to reflect the API-breaking change.

Reviewed changes

Copilot reviewed 26 out of 27 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
trzcina/src/service.rs Changes the Service trait to consume Box<Self> in run.
trzcina/src/running_service_collection.rs Adjusts service execution/classification to pass ownership into run.
trzcina/tests/supports_notify_driven_event_loop_pattern.rs Updates test service run signature to Box<Self>.
trzcina/tests/supports_mutable_internal_state_across_iterations.rs Updates test service run signature to Box<Self>.
trzcina/tests/supports_multi_channel_select_pump_pattern.rs Updates test service run signature to Box<Self>.
trzcina/tests/supports_interval_ticker_reconciliation_pattern.rs Updates test service run signature to Box<Self>.
trzcina/tests/supports_internal_retry_loop_pattern.rs Updates test service run signature to Box<Self>.
trzcina/tests/supports_actix_style_shutdown_signal_pattern.rs Refactors sender ownership and updates run signature.
trzcina/tests/run_reports_leaked_beyond_shutdown_deadline_when_service_ignores_abort.rs Updates test service run signature to Box<Self>.
trzcina/tests/run_records_string_panic_payload.rs Updates panicking service run signature to Box<Self>.
trzcina/tests/run_records_string_literal_panic_payload.rs Updates panicking service run signature to Box<Self>.
trzcina/tests/run_records_service_panic_and_cancels_siblings.rs Splits configured service into dedicated services; updates run signature.
trzcina/tests/run_records_service_error_and_cancels_siblings.rs Splits configured service into dedicated services; updates run signature.
trzcina/tests/run_records_non_string_panic_payload.rs Updates test service run signature to Box<Self>.
trzcina/tests/run_records_all_failures_when_multiple_services_error.rs Splits configured service into dedicated services; updates run signature.
trzcina/tests/run_completes_when_all_services_finish_simultaneously.rs Updates test service run signature to Box<Self>.
trzcina/tests/run_cancels_siblings_when_one_service_finishes_first.rs Splits configured service into dedicated services; updates run signature.
trzcina/tests/run_cancels_all_services_when_external_token_cancelled.rs Refactors sender ownership and updates run signature.
trzcina/tests/run_applies_cooperative_and_abort_deadlines_independently.rs Updates test service run signature to Box<Self>.
trzcina/tests/run_aborts_hung_services_on_external_cancel.rs Updates test service run signature to Box<Self>.
trzcina/tests/run_aborts_hung_service_after_shutdown_deadline.rs Updates test service run signature to Box<Self>.
trzcina/tests/register_service_runs_registered_service.rs Refactors sender ownership and updates run signature.
trzcina/tests/register_bundle_runs_all_services_returned_by_bundle.rs Splits bundle/service types; refactors sender ownership and run signature.
trzcina/tests/coordinates_via_shared_holder_between_two_services.rs Splits producer/consumer; refactors sender ownership and run signature.
trzcina/Cargo.toml Bumps crate version to 0.3.0.
README.md Updates example Service::run signature to self: Box<Self>.
Cargo.lock Updates locked crate version to 0.3.0.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread trzcina/tests/supports_actix_style_shutdown_signal_pattern.rs
Comment thread trzcina/tests/register_service_runs_registered_service.rs
Comment thread trzcina/tests/run_records_service_error_and_cancels_siblings.rs
Comment thread trzcina/tests/run_records_service_panic_and_cancels_siblings.rs
Comment thread trzcina/tests/coordinates_via_shared_holder_between_two_services.rs
Comment thread trzcina/tests/run_records_string_panic_payload.rs
@mcharytoniuk mcharytoniuk merged commit 8acb701 into main May 22, 2026
6 checks passed
@mcharytoniuk mcharytoniuk deleted the service-run-consume-self branch May 22, 2026 17:19
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.

2 participants