pub struct ResourceEndpoint {
pub register: fn(Router, Arc<Context>) -> Router,
pub openapi: Option<fn() -> OpenApi>,
}Expand description
A registered resource endpoint. Extension macros generate instances of this
struct and submit them via inventory::submit!. The register function
takes an existing router and context, and returns a new router with the
resource’s endpoints added.
The optional openapi function returns an OpenAPI spec fragment for the
resource’s endpoints. When present, the router builder merges all fragments
into a single spec served at /openapi.json.
Fields§
§register: fn(Router, Arc<Context>) -> Router§openapi: Option<fn() -> OpenApi>Trait Implementations§
impl Collect for ResourceEndpoint
Auto Trait Implementations§
impl Freeze for ResourceEndpoint
impl RefUnwindSafe for ResourceEndpoint
impl Send for ResourceEndpoint
impl Sync for ResourceEndpoint
impl Unpin for ResourceEndpoint
impl UnsafeUnpin for ResourceEndpoint
impl UnwindSafe for ResourceEndpoint
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