pub struct MountFn<'a> {
pub tokens: &'a HandlerTokens,
pub sig: &'a HandlerSig,
pub key: &'a str,
pub paths: &'a Paths,
pub handler_value: TokenStream,
pub route: Option<TokenStream>,
pub shape: Option<TokenStream>,
}Expand description
One handler’s three owed items.
Fields§
§tokens: &'a HandlerTokens§sig: &'a HandlerSig§key: &'a strThe transport’s key as a literal, which __enhancer_specs! filters scoped entries by. It
equals <Marker as Transport>::KEY; the transport crate keeps the two in step.
paths: &'a Paths§handler_value: TokenStreamAn expression evaluating to the transport’s handler value, the H of HandlerSpec<T, H>.
It may name call_ident, bound by the mount function to the call closure, and
mount_param_ident, the mount function’s &mut Mount<'_>: a WebSocket message handler’s
value is a block that first calls <m>.once::<Self>(..) to mount its gateway’s connect
handler (transports DESIGN §4.1, X15).
route: Option<TokenStream>.route(..)’s argument, when the transport has one.
shape: Option<TokenStream>.shape(..)’s argument, when the handler’s shape is not Unary.
Implementations§
Source§impl MountFn<'_>
impl MountFn<'_>
Sourcepub fn emit(&self) -> TokenStream
pub fn emit(&self) -> TokenStream
__ULO_KEY_<name>, __ULO_CHECKS_<name> and __ulo_mount_<name>, as impl items.
A handler with a type or const parameter gets a compile_error! spanned at its name in
place of a working mount function: the call names each parameter’s type inside the mount
function, where the method’s own parameters are not in scope. The three items are still
written, empty, so #[handlers]’s reads of them resolve and the refusal is the one error.