pub struct RestDispatcher { /* private fields */ }Expand description
REST HTTP request dispatcher.
Routes requests by HTTP method and path to the underlying RequestHandler.
Optionally applies CORS headers to all responses.
Implementations§
Source§impl RestDispatcher
impl RestDispatcher
Sourcepub fn new(handler: Arc<RequestHandler>) -> Self
pub fn new(handler: Arc<RequestHandler>) -> Self
Creates a new REST dispatcher.
Sourcepub fn with_cors(self, cors: CorsConfig) -> Self
pub fn with_cors(self, cors: CorsConfig) -> Self
Sets CORS configuration for this dispatcher.
When set, all responses will include CORS headers, and OPTIONS preflight
requests will be handled automatically.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for RestDispatcher
impl !RefUnwindSafe for RestDispatcher
impl Send for RestDispatcher
impl Sync for RestDispatcher
impl Unpin for RestDispatcher
impl UnsafeUnpin for RestDispatcher
impl !UnwindSafe for RestDispatcher
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