bit of cleanup, few steps towards commands demo

This commit is contained in:
2026-04-18 15:13:27 +00:00
parent 6eed6b9831
commit 60c96964d9
12 changed files with 228 additions and 538 deletions

View File

@@ -18,7 +18,7 @@ struct WriterState {
writer: Pin<Box<dyn AsyncWrite>>,
}
pub struct OrcWriter<T: AsyncWrite + 'static>(T);
pub struct OrcWriter<T: AsyncWrite + 'static>(pub T);
impl<T: AsyncWrite + 'static> ToExpr for OrcWriter<T> {
async fn to_gen(self) -> GExpr {
new_atom(WriterAtom(Rc::new(Mutex::new(WriterState {
@@ -61,7 +61,7 @@ impl Supports<OutputReq> for WriterAtom {
}
}
pub struct OrcReader<T: AsyncRead + 'static>(T);
pub struct OrcReader<T: AsyncRead + 'static>(pub T);
impl<T: AsyncRead + 'static> ToExpr for OrcReader<T> {
async fn to_gen(self) -> GExpr {
new_atom(ReaderAtom(Rc::new(Mutex::new(BufReader::new(Box::pin(self.0))))))

View File

@@ -16,10 +16,10 @@ pub type ReqForSystem<T> = <CardForSystem<T> as SystemCard>::Req;
/// System as defined by author
pub trait System: Debug + 'static {
type Ctor: SystemCtor<Instance = Self>;
fn prelude(&self) -> impl Future<Output = Vec<Sym>>;
fn env(&self) -> impl Future<Output = Vec<GenMember>>;
fn lexers(&self) -> Vec<LexerObj>;
fn parsers(&self) -> Vec<ParserObj>;
fn prelude(&self) -> impl Future<Output = Vec<Sym>> { futures::future::ready(Vec::new()) }
fn env(&self) -> impl Future<Output = Vec<GenMember>> { futures::future::ready(Vec::new()) }
fn lexers(&self) -> Vec<LexerObj> { Vec::new() }
fn parsers(&self) -> Vec<ParserObj> { Vec::new() }
fn request<'a>(
&self,
hand: Box<dyn ReqHandle<'a> + 'a>,