pub struct Resources { /* private fields */ }
Expand description
A resourceful route provides a mapping between HTTP verbs and URLs to handlers.
Implementations§
source§impl Resources
impl Resources
sourcepub fn route<S>(self, path: S, route: Route) -> Self
pub fn route<S>(self, path: S, route: Route) -> Self
Inserts a path-route pair into the resources.
sourcepub fn update_with_patch<H, O>(self, handler: H) -> Self
pub fn update_with_patch<H, O>(self, handler: H) -> Self
Updates the resources, by the PATCH
verb.
sourcepub fn map_handler<F>(self, f: F) -> Self
pub fn map_handler<F>(self, f: F) -> Self
Takes a closure and creates an iterator which calls that closure on each handler.
sourcepub fn with_handler<H>(self, f: H) -> Self
pub fn with_handler<H>(self, f: H) -> Self
Adds a middleware for the resources.
Trait Implementations§
source§impl IntoIterator for Resources
impl IntoIterator for Resources
Auto Trait Implementations§
impl Freeze for Resources
impl !RefUnwindSafe for Resources
impl Send for Resources
impl Sync for Resources
impl Unpin for Resources
impl !UnwindSafe for Resources
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)