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

Make HistoryService methods async #140

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

progval
Copy link
Contributor

@progval progval commented Oct 20, 2024

We are going to need that for the PostgreSQL implementation

@spb This fails to compile with:

error[E0277]: Invalid command handler
  --> sable_ircd/src/command/handlers/chathistory.rs:47:1
   |
47 | #[command_handler("CHATHISTORY")]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `for<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i> fn(&'a (dyn command::plumbing::Command + 'a), source_types::UserSource<'b>, &'c server::ClientServer, &'d (dyn command_response::CommandResponse + 'd), &'e str, &'f str, &'g str, &'h str, std::option::Option<&'i str>) -> impl futures::Future<Output = Result<(), command::error::CommandError>> {handle_chathistory}` is not a valid command handler
   |
   = help: the trait `handler::AsyncHandlerFn<'_, _, _>` is not implemented for fn item `for<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i> fn(&'a (dyn command::plumbing::Command + 'a), source_types::UserSource<'b>, &'c server::ClientServer, &'d (dyn command_response::CommandResponse + 'd), &'e str, &'f str, &'g str, &'h str, std::option::Option<&'i str>) -> impl futures::Future<Output = Result<(), command::error::CommandError>> {handle_chathistory}`
   = note: All parameter types must implement `AmbientArgument` or `PositionalArgument`
   = note: Return type must be `CommandResult`
note: required by a bound in `call_handler_async`
  --> sable_ircd/src/command/plumbing/mod.rs:55:29
   |
53 | pub(crate) fn call_handler_async<'ctx, 'handler, Amb, Pos>(
   |               ------------------ required by a bound in this function
54 |     ctx: &'ctx dyn Command,
55 |     handler: &'handler impl AsyncHandlerFn<'ctx, Amb, Pos>,
   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `call_handler_async`
   = note: this error originates in the attribute macro `command_handler` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: Invalid command handler
  --> sable_ircd/src/command/handlers/chathistory.rs:47:1
   |
47 | #[command_handler("CHATHISTORY")]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `for<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i> fn(&'a (dyn command::plumbing::Command + 'a), source_types::UserSource<'b>, &'c server::ClientServer, &'d (dyn command_response::CommandResponse + 'd), &'e str, &'f str, &'g str, &'h str, std::option::Option<&'i str>) -> impl futures::Future<Output = Result<(), command::error::CommandError>> {handle_chathistory}` is not a valid command handler
   |
   = help: the trait `handler::AsyncHandlerFn<'_, _, _>` is not implemented for fn item `for<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i> fn(&'a (dyn command::plumbing::Command + 'a), source_types::UserSource<'b>, &'c server::ClientServer, &'d (dyn command_response::CommandResponse + 'd), &'e str, &'f str, &'g str, &'h str, std::option::Option<&'i str>) -> impl futures::Future<Output = Result<(), command::error::CommandError>> {handle_chathistory}`
   = note: All parameter types must implement `AmbientArgument` or `PositionalArgument`
   = note: Return type must be `CommandResult`
note: required by a bound in `call_handler_async`
  --> sable_ircd/src/command/plumbing/mod.rs:55:29
   |
53 | pub(crate) fn call_handler_async<'ctx, 'handler, Amb, Pos>(
   |               ------------------ required by a bound in this function
54 |     ctx: &'ctx dyn Command,
55 |     handler: &'handler impl AsyncHandlerFn<'ctx, Amb, Pos>,
   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `call_handler_async`

For more information about this error, try `rustc --explain E0277`.

any idea why?

We are going to need that for the PostgreSQL implementation
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 this pull request may close these issues.

1 participant