Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

server: Remove unused trait bounds from Service::call() future result #244

Merged
merged 2 commits into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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