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

impl Serviceの方針をスッキリさせる #245

Closed
H1rono opened this issue Dec 7, 2024 · 3 comments · Fixed by #249
Closed

impl Serviceの方針をスッキリさせる #245

H1rono opened this issue Dec 7, 2024 · 3 comments · Fixed by #249

Comments

@H1rono
Copy link
Owner

H1rono commented Dec 7, 2024

No description provided.

@H1rono
Copy link
Owner Author

H1rono commented Dec 8, 2024

impl<Service, Fallback> ::tower::Service<$crate::Event>
for [< $e:camel Service >] <Service, Fallback, $crate::payloads::[< $e:camel Payload >] >
where
Service: ::tower::Service<$crate::payloads::[< $e:camel Payload >], Response = ()>,

これに対応した1-tupleの実装

        impl<Service, Fallback> ::tower::Service<$crate::Event>
        for [< $e:camel Service >] <Service, Fallback, $crate::payloads::[< $e:camel Payload >] >
        where
            Service: ::tower::Service<($crate::payloads::[< $e:camel Payload >],), Response = ()>, ...

#233 (comment) 逆で, 1-tupleの実装は消す

@H1rono
Copy link
Owner Author

H1rono commented Dec 8, 2024

impl<S> Service<Request> for Handler<S>
where S: Service<Event, Error = crate::Error>
{ type Error = crate::Error; }

impl<S, F> Service<Event> for OnPing<S, F>
where
    S: Service<PingPayload>,
    S::Error: Into<Box<dyn StdError>>,
    F: Service<Event, Error = crate::Error>,
{ type Error = crate::Error; }

impl Service<Event> for Sink { type Error = crate::Error; }

@H1rono
Copy link
Owner Author

H1rono commented Dec 8, 2024

WithStateは内側のシグネチャをtransparentしているので問題なし

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 a pull request may close this issue.

1 participant