Coder Social home page Coder Social logo

Enum contains type of itself about ractor HOT 4 CLOSED

zrus avatar zrus commented on May 27, 2024
Enum contains type of itself

from ractor.

Comments (4)

slawlor avatar slawlor commented on May 27, 2024

What is the problem with this? You're failing to compile?

from ractor.

zrus avatar zrus commented on May 27, 2024

Yes. I missed a picture of it. Let me put it here.

error[E0061]: this enum variant takes 2 arguments but 3 arguments were supplied
   --> src/http_cli.rs:85:21
    |
85  |           call!(me, HttpCliCommand::Retry, *cmd, time);
    |           ----------^^^^^^^^^^^^^^^^^^^^^------------- unexpected argument of type `RpcReplyPort<_>`
    |
note: tuple variant defined here
   --> src/http_cli.rs:104:3
    |
104 |   Retry(Box<HttpCliCommand>, u8),
    |   ^^^^^

from ractor.

slawlor avatar slawlor commented on May 27, 2024

That's because the call! macro is expecting the last argument of the tuple of arguments to be the reply channel to send the reply on. If you actually want this pattern to work, you will have to handle piping the reply channel from the boxed internal struct. Theoretically the way you've written it you could have retry nested n-deep and there's no way for the macro to desugar that.

Essentially the macro won't work here and there isn't a solution to make it work. You'll have to do it by hand using ActorRef<_>::call

from ractor.

zrus avatar zrus commented on May 27, 2024

Sorry, my bad. I actually need to use .send_massage instead of call! macro. Thanks for your reply.

from ractor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.