Skip to content

Commit

Permalink
server: Remove unused trait bounds from Service::call() future resu…
Browse files Browse the repository at this point in the history
…lt (#244)

* server: Remove unused trait bounds from `Service::call()` future result
* Add missing ?Sized
  • Loading branch information
uklotzde authored Jan 15, 2024
1 parent 458c6a7 commit 2a7ae27
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@

# Changelog

## v0.10.1 (Unreleased)

- Server: Remove `Sync` and `Unpin` trait bounds from `Service::call()` future
result.

## v0.10.0 (2024-01-03)

- Feature: Retrieve the `FunctionCode` of a `Request`/`Response`.
- Feature: Added `rtu-over-tcp-server` for _RTU over TCP_ server skeleton.
- Feature: Add `rtu-over-tcp-server` for _RTU over TCP_ server skeleton.

### Breaking Changes

Expand Down
7 changes: 3 additions & 4 deletions src/server/service.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// SPDX-FileCopyrightText: Copyright (c) 2017-2024 slowtec GmbH <[email protected]>
// SPDX-License-Identifier: MIT OR Apache-2.0

use std::future::Future;
use std::ops::Deref;
use std::{future::Future, ops::Deref};

/// A Modbus server service.
pub trait Service {
Expand All @@ -16,15 +15,15 @@ pub trait Service {
type Error;

/// The future response value.
type Future: Future<Output = Result<Self::Response, Self::Error>> + Send + Sync + Unpin;
type Future: Future<Output = Result<Self::Response, Self::Error>> + Send;

/// Process the request and return the response asynchronously.
fn call(&self, req: Self::Request) -> Self::Future;
}

impl<D> Service for D
where
D: Deref,
D: Deref + ?Sized,
D::Target: Service,
{
type Request = <D::Target as Service>::Request;
Expand Down

0 comments on commit 2a7ae27

Please sign in to comment.