#[non_exhaustive]pub struct HandlerOutput {
pub primary: Value,
pub extra_invocations: Vec<Invocation>,
pub unreadable: BTreeMap<Id, BTreeSet<String>>,
}Expand description
The successful result of one JmapHandler::call.
#[non_exhaustive] so fields can be added without breaking handler
crates; build it with HandlerOutput::new and
HandlerOutput::with_extra.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.primary: ValueThe method’s response arguments. The dispatcher pairs this with the call’s method name and call id as the primary response invocation.
extra_invocations: Vec<Invocation>Zero or more invocations appended to methodResponses immediately
after the primary response, in order. Most handlers leave this
empty. RFC 8621 §7.5 EmailSubmission/set uses it for the implicit
Email/set response for onSuccessUpdateEmail.
unreadable: BTreeMap<Id, BTreeSet<String>>Per object id, the top-level properties this /get response blanked
or left out because the caller may not read them. Never written to
the wire: the dispatcher’s draft-ietf-jmap-conditional-02
evaluator answers a precondition on one of them forbidden (§9.1).
Empty for most handlers.
Implementations§
Source§impl HandlerOutput
impl HandlerOutput
Sourcepub fn with_extra(self, extra_invocations: Vec<Invocation>) -> Self
pub fn with_extra(self, extra_invocations: Vec<Invocation>) -> Self
Set the invocations to append after the primary response.
Sourcepub fn with_unreadable(self, unreadable: BTreeMap<Id, BTreeSet<String>>) -> Self
pub fn with_unreadable(self, unreadable: BTreeMap<Id, BTreeSet<String>>) -> Self
Set HandlerOutput::unreadable: the properties a /get response
withheld from the caller, by object id.