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

Update doc example of actix middleware #227

Open
tumbl3w33d opened this issue Apr 29, 2021 · 2 comments
Open

Update doc example of actix middleware #227

tumbl3w33d opened this issue Apr 29, 2021 · 2 comments
Labels
code Change to code samples good-first-issue Good for newcomers

Comments

@tumbl3w33d
Copy link

Hi,

since v2 this middleware documentation example won't compile anymore due to lack of Req type declaration: https://actix.rs/docs/middleware/

I've been fiddling around with it to make my middleware compatible, but couldn't figure this one out:

impl<S, B> Transform<S, B> for MyMiddleware
where
    S: Service<Request = ServiceRequest, Response = ServiceResponse<B>, Error = Error>,
    S::Future: 'static,
    B: 'static,
{

the compiler complains about
S: Service<Request = ServiceRequest, Response = ServiceResponse<B>, Error = Error>,
because

wrong number of type arguments: expected 1, found 0
expected 1 type argument
@JohnTitor JohnTitor transferred this issue from actix/actix-net Apr 29, 2021
@fakeshadow
Copy link

It should be noted that actix-service 2 does not compat with actix-web v3. So this is not an issue for now as website would not migrate to actix-web v4 until it's stable.

If you are using betas you want to look into change log and crate level docs.

@tumbl3w33d
Copy link
Author

Thanks for transferring my issue and the info about web v3 not being compatible. I'm not using beta releases, but I only got the web major version pinned and my other dependencies rolling (*). I realized now that you told me, that I should probably look at web's toml to find out about compatible versions.

@robjtede robjtede added good-first-issue Good for newcomers code Change to code samples labels Jul 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code Change to code samples good-first-issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants