Problem
The DNP3 library calls tokio::spawn internally in all spawn_* creation functions. This prevents callers from controlling which Tokio runtime or task set the futures are placed on.
Status
feature/no-spawn implements the master portion with unstable MasterBuilder / UdpMasterBuilder APIs. Associations are registered synchronously with add_association(...), which fails immediately on duplicate addresses and returns a scoped AssociationBuilder<'_> for adding polls. into_handle() releases the builder borrow, and the transport-specific into_* methods produce a MasterTask with async fn run(self).
The TCP outstation Server::into_task(listener) API synchronously consumes an already-bound listener and returns a ServerHandle plus an unpolled server task future. Existing stable bind_no_spawn() delegates to the same internal construction path.
The serial outstation API uses a fail-fast typestate flow: SerialOutstation::new(...) configures the protocol implementation synchronously, open(path, settings).await produces a SerialOutstationTask only after the port opens successfully, and run(self) permanently ends on shutdown or serial-port failure. The retrying spawn_outstation_serial_2() remains a separate stable API.
Remaining work
unstable feature flag
Only the non-spawning APIs introduced as part of this 1.7.0 work go behind an unstable Cargo feature:
- Exempt from semver: while items remain behind the flag, they may change or disappear in any release, including patch releases. This policy is documented beside the feature in
Cargo.toml; the gated items are absent from the default published rustdoc.
- No FFI schema entries and no guide pages for gated APIs.
- Covers:
MasterBuilder, UdpMasterBuilder, AssociationBuilder, MasterTask, Server::into_task, SerialOutstation, and SerialOutstationTask.
- Existing stable APIs, including
Server::bind_no_spawn and Server::add_outstation_no_spawn, are explicitly excluded and remain ungated.
- General connection-handler conveniences such as the
EndpointList::into_connect_handler* methods are separate stable API work and are not covered by this gate.
#276 concerns the existing stable no_spawn methods and is outside the scope of this issue.
Non-goals
- FFI / language binding changes
- Additional TLS-specific API work
- Changes to existing public config types (semver)
Problem
The DNP3 library calls
tokio::spawninternally in allspawn_*creation functions. This prevents callers from controlling which Tokio runtime or task set the futures are placed on.Status
feature/no-spawnimplements the master portion with unstableMasterBuilder/UdpMasterBuilderAPIs. Associations are registered synchronously withadd_association(...), which fails immediately on duplicate addresses and returns a scopedAssociationBuilder<'_>for adding polls.into_handle()releases the builder borrow, and the transport-specificinto_*methods produce aMasterTaskwithasync fn run(self).The TCP outstation
Server::into_task(listener)API synchronously consumes an already-bound listener and returns aServerHandleplus an unpolled server task future. Existing stablebind_no_spawn()delegates to the same internal construction path.The serial outstation API uses a fail-fast typestate flow:
SerialOutstation::new(...)configures the protocol implementation synchronously,open(path, settings).awaitproduces aSerialOutstationTaskonly after the port opens successfully, andrun(self)permanently ends on shutdown or serial-port failure. The retryingspawn_outstation_serial_2()remains a separate stable API.Remaining work
SerialOutstation→open()→SerialOutstationTask::run()flow with no internal spawn or retry loopServer::into_task(listener)takes an already-bound listener synchronously and returns the server handle and task futureunstablefeatureunstablefeature inCargo.tomlunstableunstablefeature in CIunstablefeature flagOnly the non-spawning APIs introduced as part of this 1.7.0 work go behind an
unstableCargo feature:Cargo.toml; the gated items are absent from the default published rustdoc.MasterBuilder,UdpMasterBuilder,AssociationBuilder,MasterTask,Server::into_task,SerialOutstation, andSerialOutstationTask.Server::bind_no_spawnandServer::add_outstation_no_spawn, are explicitly excluded and remain ungated.EndpointList::into_connect_handler*methods are separate stable API work and are not covered by this gate.#276 concerns the existing stable
no_spawnmethods and is outside the scope of this issue.Non-goals