Static ReadonlymakeBuilds the scoped transport service effect. The transport opens on first use and its connection closes when the consuming scope ends.
An effect that provides the service for the lifetime of its scope.
Static ReadonlymakeCreates a Layer providing a live WasmRtuTransportService.
Connection and resilience options for the transport.
A layer that provides the scoped service.
StaticmakeCreates a Layer providing an in-memory mock WasmRtuTransportService for testing or development.
Accepts an array of SlaveDeviceDefinitions describing the simulated Modbus slaves and their register/coil maps.
Slave device definitions for the mock.
A function that takes WasmRtuTransportOpenOptions and returns a scoped Layer providing the mock service. The mock uses device definitions and fault hooks instead of browser I/O.
Scoped Effect service wrapping
modbus-rs's browser WasmRtuTransport for Modbus RTU over the Web Serial API. The caller obtains the port handle; this service does not request browser permission.The transport connection is opened lazily on the first call to
withClient(unitId)and automatically closed when the consuming scope finalizes.Clients are created per
unitIdvia WasmRtuTransport.createClient and cached, so repeated requests for the same unit ID reuse the same client.See
modbus-rsbrowser Web Serial RTU transport.portoption needs.