phlow 3.0.0

An engine for scripting reactive browsers in Rust by adding custom views to structures
Documentation
#[macro_use]
extern crate phlow;

use phlow::view_functions_of_val;

environment!();

#[extensions(String)]
mod string_extensions {
    use phlow::{PhlowView, ProtoView};

    #[view]
    fn string_text_view(_string: &String, view: impl ProtoView<String>) -> impl PhlowView {
        view.text()
            .title("String")
            .priority(2)
            .text(|value| format!("This is a Text view of: {:?}", value))
    }
}

pub fn main() {
    let string = "Hello".to_string();
    let view_method = view_functions_of_val(&string)
        .into_iter()
        .find(|f| f.name() == "string_text_view")
        .unwrap();

    let _view = view_method.as_view(&string);
}