Struct linebased::Server [−][src]
pub struct Server { /* fields omitted */ }
The linebased TCP server
Implementations
impl Server
[src]
impl Server
[src]pub fn new<F>(config: Config, func: F) -> Result<Server> where
F: Fn(&str) -> String + 'static + Send + Sync,
[src]
F: Fn(&str) -> String + 'static + Send + Sync,
Create a new server
use linebased::Server; // Create a server with the default config and a // handler that only knows the "version" command let mut server = Server::new(Default::default(), |query| { match query { "version" => { String::from("0.1.0") }, _ => { String::from("unknown command") } } }).unwrap();
pub fn handle(&self) -> Handle
[src]
Get a handle for the server so graceful shutdown can be requested
pub async fn run(&mut self) -> Result<()>
[src]
Run the event loop
Auto Trait Implementations
impl !RefUnwindSafe for Server
impl !RefUnwindSafe for Server
impl !UnwindSafe for Server
impl !UnwindSafe for Server