pub struct Api { /* private fields */ }Expand description
§Api
A collections of endpoints that can be run to start the REST server
§Example
use rustful_api::*;
let mut api = Api::new();
fn handle_root_request(request: Request) -> Response {
println!("Received request on path '/'!");
Response {code: 204}
}
api.add_endpoint(Method::GET, String::from("/"), handle_root_request);
// api.start(None, None);Implementations§
Auto Trait Implementations§
impl Freeze for Api
impl RefUnwindSafe for Api
impl Send for Api
impl Sync for Api
impl Unpin for Api
impl UnsafeUnpin for Api
impl UnwindSafe for Api
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