I got very confused and started mucking about with "spawn" when in fact all I needed was the "inline" extension type in orcx that allows the interpreter to expose custom constants.
14 lines
336 B
Rust
14 lines
336 B
Rust
use std::pin::Pin;
|
|
use std::rc::Rc;
|
|
use std::time::Duration;
|
|
|
|
use futures::future::LocalBoxFuture;
|
|
use futures::{AsyncRead, AsyncWrite};
|
|
|
|
pub struct ExtPort {
|
|
pub input: Pin<Box<dyn AsyncRead>>,
|
|
pub output: Pin<Box<dyn AsyncWrite>>,
|
|
pub log: Pin<Box<dyn AsyncWrite>>,
|
|
pub spawn: Rc<dyn Fn(Duration, LocalBoxFuture<'static, ()>)>,
|
|
}
|