[][src]Enum uniui_build::Framework

#[non_exhaustive]pub enum Framework {
    Rocket,
    Tide,
}

Supported web frameworks

Variants (Non-exhaustive)

Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Rocket

Rocket

WasmBuilder will generate mount_to function which may be used to mount all generated pages to [rocket::Rocket]

mod generated {
    // There will be a function
    // pub fn mount_to(rocket: rocket::Rocket) -> rocket::Rocket
    include!(concat!(env!("OUT_DIR"), "/uni_build_generated.rs"));
}

fn main() {
    let ignite = rocket::ignite();
    let ignite = generated::mount_to(ignite);
    ignite.launch();
}
Tide

Tide

WasmBuilder will generate attach function which may be used to attach all generated pages to [tide::Server]

mod generated {
    // There will be a function
    // pub fn attach<T>(app: &mut tide::Server<T>)
    // where T : 'static + Send + Sync + Clone
    include!(concat!(env!("OUT_DIR"), "/uni_build_generated.rs"));
}

fn main() -> Result<(), std::io::Error> {

    return async_std::task::block_on(async {
        // create regular tide::Server
        let mut app = tide::new();

        // Attach all generated pages to the tide::Server
        generated::attach(&mut app);

        // Start tide::Server
        app.listen("localhost:8080").await?;

        Ok(())
    });
}

Trait Implementations

impl Clone for Framework[src]

impl Copy for Framework[src]

impl Debug for Framework[src]

Auto Trait Implementations

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.