pub struct Server {
pub config: Config,
}Expand description
RServer’s Server struct.
Fields§
§config: ConfigImplementations§
Source§impl Server
impl Server
pub fn new(config: Config) -> Self
Sourcepub async fn start(self) -> Result<(), Box<dyn Error>>
pub async fn start(self) -> Result<(), Box<dyn Error>>
Start server at the given host and port which will handle requests recieved from clients/apps.
Example
use rserver::Config;
use rserver::Server;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let config = Config::default();
let server = Server::new(config);
server.start().await
}Auto Trait Implementations§
impl Freeze for Server
impl RefUnwindSafe for Server
impl Send for Server
impl Sync for Server
impl Unpin for Server
impl UnsafeUnpin for Server
impl UnwindSafe for Server
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