Crate whynot

Crate whynot 

Source
Expand description

§whyNot

Rust ↔ PHP bridge: call PHP functions from Rust, capture return values, printed output, and exceptions. Supports async via threads or Tokio.

§Examples

use whynot::{new_runtime, PhpRuntime, RuntimeConfig, RuntimeKind};

fn main() {
    let cfg = RuntimeConfig::default();
    let mut rt = new_runtime(RuntimeKind::Process(cfg)).unwrap();
    let result = rt.call("add", &[7.into(), 5.into()]).unwrap();
    println!("add.result = {:?}", result.result);
}

Re-exports§

pub use value::PhpValue;

Modules§

embedded
macros
process
value

Macros§

php_call
php_eval
php_include

Structs§

PhpCallResult
PhpError
PhpException
RuntimeConfig

Enums§

RuntimeKind

Traits§

PhpRuntime

Functions§

new_runtime