base and extension fully compiles, host in good shape

This commit is contained in:
2025-01-25 00:10:49 +01:00
parent 7be8716b19
commit 2b79e96dc9
49 changed files with 1719 additions and 1168 deletions

View File

@@ -21,22 +21,16 @@ pub struct ExprHandle {
impl ExprHandle {
pub(crate) fn from_args(ctx: SysCtx, tk: api::ExprTicket) -> Self { Self { ctx, tk } }
pub fn get_ctx(&self) -> SysCtx { self.ctx.clone() }
pub async fn clone(&self) -> Self {
self.ctx.reqnot.notify(api::Acquire(self.ctx.id, self.tk)).await;
Self { ctx: self.ctx.clone(), tk: self.tk }
}
}
impl fmt::Debug for ExprHandle {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "ExprHandle({})", self.tk.0)
}
}
impl Clone for ExprHandle {
fn clone(&self) -> Self {
let SysCtx { reqnot, spawner, .. } = self.ctx.clone();
let notif = api::Acquire(self.ctx.id, self.tk);
if let Err(e) = spawner.spawn_local(async move { reqnot.notify(notif).await }) {
panic!("Failed to schedule cloning notification, resource may not exist: {e}");
}
Self { ctx: self.ctx.clone(), tk: self.tk }
}
}
impl Drop for ExprHandle {
fn drop(&mut self) {
let notif = api::Release(self.ctx.id, self.tk);