feat(host): add object publication and dispatch

This commit is contained in:
2026-09-28 23:36:50 +09:00
parent 3f94d48f04
commit 32f3fb6fb1
11 changed files with 1267 additions and 8 deletions
@@ -0,0 +1,22 @@
use wip_host::{InterfaceRegistry, PublishedObject, WipObject};
use wip_interface::{OperationResult, interface};
use wip_protocol::ObjectId;
#[interface]
pub trait Search {
fn search(&self) -> OperationResult<String>;
}
struct Object;
impl WipObject for Object {
fn id(&self) -> ObjectId {
ObjectId("object".into())
}
}
fn main() {
let mut registry = InterfaceRegistry::new();
let search = registry.register(SearchDefinition, None).unwrap();
let _published = PublishedObject::new(Object).expose(&search).unwrap();
}