Skip to content
This repository has been archived by the owner on Aug 16, 2021. It is now read-only.

How to implement complex display expression? #268

Open
jmjoy opened this issue Jul 5, 2019 · 0 comments
Open

How to implement complex display expression? #268

jmjoy opened this issue Jul 5, 2019 · 0 comments

Comments

@jmjoy
Copy link

jmjoy commented Jul 5, 2019

For example:

errors {
        #[doc = "Response not complete, first is protocol status and second is app status, see fastcgi protocol."]
        EndRequest(protocol_status: ProtocolStatus, app_status: u32) {
            description("End request error."),
            display(match protocol_status {
                ProtocolStatus::CantMpxConn => "This app can't multiplex [CantMpxConn]; AppStatus: {}",
                ProtocolStatus::Overloaded => "New request rejected; too busy [OVERLOADED]; AppStatus: {}",
                ProtocolStatus::UnknownRole => "Role value not known [UnknownRole]; AppStatus: {}",
                _ => unreachable!(),
            }, app_status),
        }

}

But now, display not support first argument is string literal, so more complex expression of display is not work, is there a choice to support it?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant