[][src]Struct ctchi::core::app::Ctchi

pub struct Ctchi { /* fields omitted */ }

Implementations

impl Ctchi[src]

pub fn new(routes: Routes) -> Ctchi[src]

Create new application with specified configuration.

Arguments:

  • config - configuration for application. ctchi::core::ctchi::Config

pub fn start(self) -> Result<()>[src]

Start configured application. Now it will lister for specified ip:port and respond for request if URI is in routes

Examples:

This example is not tested
  use ctchi::core::ctchi::{Config, Ctchi};
  use ctchi::core::routes::Routes;

  let mut routes = Routes::new();
  routes.add_route("/", "/src/pages.static/index.html");

  let configuration = Config {
       bind_path: "127.0.0.1:8080",
       base_path: "/var/www/",
       routes,
  };

  let server = Ctchi::new(configuration);
  server.start();

Auto Trait Implementations

impl RefUnwindSafe for Ctchi

impl Send for Ctchi

impl Sync for Ctchi

impl Unpin for Ctchi

impl UnwindSafe for Ctchi

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.