Skip to main content

MountFn

Struct MountFn 

Source
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 str

The 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: TokenStream

An 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<'_>

Source

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.

Auto Trait Implementations§

§

impl<'a> !Send for MountFn<'a>

§

impl<'a> !Sync for MountFn<'a>

§

impl<'a> Forget for MountFn<'a>

§

impl<'a> Freeze for MountFn<'a>

§

impl<'a> Move for MountFn<'a>

§

impl<'a> RefUnwindSafe for MountFn<'a>

§

impl<'a> Unpin for MountFn<'a>

§

impl<'a> UnsafeUnpin for MountFn<'a>

§

impl<'a> UnwindSafe for MountFn<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.