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

💥 Rename {EventKind}Service to On{EventKind} #247

Merged
merged 1 commit into from
Dec 8, 2024
Merged
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
14 changes: 7 additions & 7 deletions src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -448,15 +448,15 @@ macro_rules! event_service {
) => { ::paste::paste! {
$( #[$m] )*
$v struct
[< $e:camel Service >] <Service, Fallback, Req>
[< On $e:camel >] <Service, Fallback, Req>
{
_req: ::std::marker::PhantomData<Req>,
inner: Service,
fallback: Fallback,
}

impl<Service, Fallback> ::tower::Service<$crate::Event>
for [< $e:camel Service >] <Service, Fallback, $crate::payloads::[< $e:camel Payload >] >
for [< On $e:camel >] <Service, Fallback, $crate::payloads::[< $e:camel Payload >] >
where
Service: ::tower::Service<$crate::payloads::[< $e:camel Payload >], Response = ()>,
Service::Error: ::std::convert::Into<::std::boxed::Box<
Expand All @@ -473,7 +473,7 @@ macro_rules! event_service {
}

impl<State, Service, Fallback> ::tower::Service<(State, $crate::handler::Event)>
for [< $e:camel Service >] <Service, Fallback, $crate::payloads::[< $e:camel Payload >] >
for [< On $e:camel >] <Service, Fallback, $crate::payloads::[< $e:camel Payload >] >
where
Service: ::tower::Service<$crate::payloads::[< $e:camel Payload >], Response = ()>,
Service::Error: ::std::convert::Into<::std::boxed::Box<
Expand All @@ -490,7 +490,7 @@ macro_rules! event_service {
}

impl<State, Service, Fallback> ::tower::Service<(State, $crate::handler::Event)>
for [< $e:camel Service >] <Service, Fallback, ($crate::payloads::[< $e:camel Payload >],) >
for [< On $e:camel >] <Service, Fallback, ($crate::payloads::[< $e:camel Payload >],) >
where
Service: ::tower::Service<
($crate::payloads::[< $e:camel Payload >],),
Expand All @@ -510,7 +510,7 @@ macro_rules! event_service {
}

impl<State, Service, Fallback> ::tower::Service<(State, $crate::handler::Event)>
for [< $e:camel Service >] <Service, Fallback, (State, $crate::payloads::[< $e:camel Payload >] )>
for [< On $e:camel >] <Service, Fallback, (State, $crate::payloads::[< $e:camel Payload >] )>
where
Service: ::tower::Service<
(State, $crate::payloads::[< $e:camel Payload >]),
Expand Down Expand Up @@ -541,7 +541,7 @@ macro_rules! handler_on_events {
$(
$( #[$m] )*
$v fn [< on_ $e:snake:lower >] <Service2, Req> (self, service: Service2)
-> $crate::Handler<$crate::handler::[< $e:camel Service >] <Service2, Service1, Req>>
-> $crate::Handler<$crate::handler::[< On $e:camel >] <Service2, Service1, Req>>
where
Service2: ::tower::Service<Req>,
{
Expand All @@ -550,7 +550,7 @@ macro_rules! handler_on_events {
parser,
} = self;
$crate::Handler {
service: $crate::handler::[< $e:camel Service >] {
service: $crate::handler::[< On $e:camel >] {
_req: ::std::marker::PhantomData,
inner: service,
fallback,
Expand Down
Loading