pub struct SubApi<A: ApiSpec, H> { /* private fields */ }Expand description
A wrapper that pairs a sub-API with its handler tuple.
Allows composing APIs larger than 22 endpoints by nesting sub-APIs.
§Example
ⓘ
type UsersAPI = (GetEndpoint<UsersPath, Vec<User>>, PostEndpoint<UsersPath, CreateUser, User>);
type OrdersAPI = (GetEndpoint<OrdersPath, Vec<Order>>,);
type FullAPI = (UsersAPI, OrdersAPI);
Server::<FullAPI>::new((
SubApi::<UsersAPI, _>::new((bind!(list_users), bind!(create_user))),
SubApi::<OrdersAPI, _>::new((bind!(list_orders),)),
))A wrapper that pairs a sub-API type with its handler tuple for nested API composition.
Implementations§
Auto Trait Implementations§
impl<A, H> Freeze for SubApi<A, H>where
H: Freeze,
impl<A, H> RefUnwindSafe for SubApi<A, H>where
H: RefUnwindSafe,
A: RefUnwindSafe,
impl<A, H> Send for SubApi<A, H>
impl<A, H> Sync for SubApi<A, H>
impl<A, H> Unpin for SubApi<A, H>
impl<A, H> UnsafeUnpin for SubApi<A, H>where
H: UnsafeUnpin,
impl<A, H> UnwindSafe for SubApi<A, H>where
H: UnwindSafe,
A: UnwindSafe,
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