pub struct HandlerRegistration {
pub kind: HandlerKind,
pub message_type_name: fn() -> &'static str,
pub handler_type_name: fn() -> &'static str,
}Expand description
One handler discovered at link time by the #[handler] macro.
message_type_name and handler_type_name are function pointers to
monomorphized core::any::type_name invocations. The pointer form
is used because type_name::<T> is not yet a const fn, while
inventory::submit! requires a const-initialized static. Callers
resolve the name by calling the pointer:
(reg.message_type_name)().
Fields§
§kind: HandlerKindKind of handler.
message_type_name: fn() -> &'static strResolves to the fully-qualified type name of the message type.
handler_type_name: fn() -> &'static strResolves to the fully-qualified type name of the handler type.
Trait Implementations§
Source§impl Clone for HandlerRegistration
impl Clone for HandlerRegistration
Source§fn clone(&self) -> HandlerRegistration
fn clone(&self) -> HandlerRegistration
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HandlerRegistration
impl Debug for HandlerRegistration
impl Collect for HandlerRegistration
impl Copy for HandlerRegistration
Auto Trait Implementations§
impl Freeze for HandlerRegistration
impl RefUnwindSafe for HandlerRegistration
impl Send for HandlerRegistration
impl Sync for HandlerRegistration
impl Unpin for HandlerRegistration
impl UnsafeUnpin for HandlerRegistration
impl UnwindSafe for HandlerRegistration
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more