Skip to main content

Crate sword_macros

Crate sword_macros 

Source

Attribute Macros§

config
Defines a configuration struct for the application. This macro generates the necessary code to deserialize the struct from the configuration toml file.
connect
controller
Defines a Sword controller. Route handlers are declared directly inside the impl block using method attributes such as #[get], #[post], #[put], #[patch], #[delete], #[head], #[options], #[trace], and #[connect].
delete
event
Defines an event struct for use with the event queue.
get
handle
Registers an event handler method for an EventHandler controller.
head
injectable
Marks a struct as injectable.
interceptor
Marks a route or controller with one or more interceptors. This macro can be used to apply an Interceptor to different controller kinds, such as web controllers or Socket.IO controllers.
main
This is just a re-export of tokio::main to simplify the initial setup of
on
Unified handler attribute for Socket.IO events.
options
patch
post
put
trace

Derive Macros§

GrpcError
Derive macro for gRPC error enums.
HttpError
Derive macro for HTTP error enums.
Interceptor
Derive macro for creating interceptors.