pub enum InputOutcome {
Render {
path: String,
query: Option<String>,
session: SessionChange,
},
Rejected(String),
}Expand description
A handler’s answer to a submission.
Variants§
Render
Accepted. The server answers with this page, rendered exactly as a GET for it would be — same include resolution, same everything — so there is one path that produces a page whether or not a submission preceded it.
Fields
session: SessionChangeSession changes to apply to the response — issuing a token on a successful login, clearing one on logout. Part of the return value rather than a side effect, so a handler that grants a session says so in the value it hands back.
Rejected(String)
Refused, with a reason to show the person who submitted it.
A short sentence for a person to read. Anything longer is truncated
before it reaches the wire — see [MAX_REASON].
Implementations§
Source§impl InputOutcome
impl InputOutcome
Sourcepub fn render_query(path: impl Into<String>, query: impl Into<String>) -> Self
pub fn render_query(path: impl Into<String>, query: impl Into<String>) -> Self
Accept, and answer with path?query.
Sourcepub fn with_session(self, change: SessionChange) -> Self
pub fn with_session(self, change: SessionChange) -> Self
Attach session changes to an acceptance.
A no-op on a refusal: a refused login must not issue a session, and making that unrepresentable is better than trusting every caller to remember it.