Pending a correct test of request cancellation

This commit is contained in:
2026-04-22 15:58:34 +00:00
parent 60c96964d9
commit 7f8c247d97
31 changed files with 1059 additions and 499 deletions

View File

@@ -20,11 +20,11 @@ pub trait System: Debug + 'static {
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>(
fn request(
&self,
hand: Box<dyn ReqHandle<'a> + 'a>,
hand: Box<dyn ReqHandle>,
req: ReqForSystem<Self>,
) -> impl Future<Output = Receipt<'a>>;
) -> impl Future<Output = Receipt>;
}
pub trait DynSystem: Debug + 'static {
@@ -32,10 +32,7 @@ pub trait DynSystem: Debug + 'static {
fn dyn_env(&self) -> LocalBoxFuture<'_, Vec<GenMember>>;
fn dyn_lexers(&self) -> Vec<LexerObj>;
fn dyn_parsers(&self) -> Vec<ParserObj>;
fn dyn_request<'a, 'b: 'a>(
&'a self,
hand: Box<dyn ReqReader<'b> + 'b>,
) -> LocalBoxFuture<'a, Receipt<'b>>;
fn dyn_request<'a, 'b: 'a>(&'a self, hand: Box<dyn ReqReader>) -> LocalBoxFuture<'a, Receipt>;
fn card(&self) -> Box<dyn DynSystemCard>;
}
@@ -46,8 +43,8 @@ impl<T: System> DynSystem for T {
fn dyn_parsers(&self) -> Vec<ParserObj> { self.parsers() }
fn dyn_request<'a, 'b: 'a>(
&'a self,
mut hand: Box<dyn ReqReader<'b> + 'b>,
) -> LocalBoxFuture<'a, Receipt<'b>> {
mut hand: Box<dyn ReqReader>,
) -> LocalBoxFuture<'a, Receipt> {
Box::pin(async move {
let value = hand.read_req().await.unwrap();
self.request(hand.finish().await, value).await