pub struct Metadata { /* private fields */ }Expand description
The metadata declared on one handler with #[meta(..)], on the method and on its controller
impl (transports DESIGN §2.5).
Values are plain Send + Sync + 'static values, built once when the handler mounts. A guard or
interceptor reads them through cx.exec().handler(); HandlerInfo::meta
answers the method’s declaration when there is one and the controller’s otherwise.
The type lives in the core because the core’s HandlerSpec and HandlerInfo carry it;
ulo-transport re-exports it.
Implementations§
Source§impl Metadata
impl Metadata
pub fn new() -> Self
Sourcepub fn controller<T: Send + Sync + 'static>(&mut self, value: T) -> &mut Self
pub fn controller<T: Send + Sync + 'static>(&mut self, value: T) -> &mut Self
A value declared on the controller impl.
Sourcepub fn method<T: Send + Sync + 'static>(&mut self, value: T) -> &mut Self
pub fn method<T: Send + Sync + 'static>(&mut self, value: T) -> &mut Self
A value declared on the handler method.
Sourcepub fn get<T: 'static>(&self) -> Option<&T>
pub fn get<T: 'static>(&self) -> Option<&T>
The most specific declaration of T: the method’s if it has one, otherwise the
controller’s. Within one tier the first written answers.
Sourcepub fn get_all<T: 'static>(&self) -> impl Iterator<Item = &T> + '_
pub fn get_all<T: 'static>(&self) -> impl Iterator<Item = &T> + '_
Every declaration of T, the method’s first, each tier in the order written.
Sourcepub fn entries(&self) -> impl Iterator<Item = (&'static str, MetaTier)> + '_
pub fn entries(&self) -> impl Iterator<Item = (&'static str, MetaTier)> + '_
Every declaration, as its type’s name and the tier that declared it, the method’s first.