Files
orchid/orchid-api-traits/src/relations.rs
Lawrence Bethlenfalvy 32d6237dc5 task_local context over context objects
- interner impls logically separate from API in orchid-base (default host interner still in base for testing)
- error reporting, logging, and a variety of other features passed down via context in extension, not yet in host to maintain library-ish profile, should consider options
- no global spawn mechanic, the host has a spawn function but extensions only get a stash for enqueuing async work in sync callbacks which is then explicitly, manually, and with strict order popped and awaited
- still deadlocks nondeterministically for some ungodly reason
2026-01-01 14:54:29 +00:00

31 lines
588 B
Rust

use core::fmt;
use never::Never;
use super::coding::Coding;
use crate::helpers::enc_vec;
pub trait Request: fmt::Debug + Sized + 'static {
type Response: fmt::Debug + Coding + 'static;
}
pub fn respond<R: Request>(_: &R, rep: R::Response) -> Vec<u8> { enc_vec(&rep) }
pub trait Channel: 'static {
type Req: Coding + Sized + 'static;
type Notif: Coding + Sized + 'static;
}
impl Channel for Never {
type Notif = Never;
type Req = Never;
}
pub trait MsgSet: Sync + 'static {
type In: Channel;
type Out: Channel;
}
impl MsgSet for Never {
type In = Never;
type Out = Never;
}