1
0
Fork 0
forked from wry/wry

wire: move message buffers into workspace crates

This commit is contained in:
kossLAN 2026-05-29 11:07:43 -04:00
parent d8380b3dce
commit a1e4641e82
No known key found for this signature in database
18 changed files with 187 additions and 166 deletions

View file

@ -85,14 +85,10 @@ use {
},
arrayvec::ArrayVec,
linearize::{Linearize, StaticMap},
std::{
cell::Cell,
error::Error,
fmt::{Display, Formatter},
rc::Rc,
},
std::{cell::Cell, error::Error, rc::Rc},
thiserror::Error,
};
pub use jay_wire_types::GlobalName;
#[derive(Debug, Error)]
pub enum GlobalsError {
@ -112,25 +108,6 @@ pub struct GlobalError {
pub error: Box<dyn Error>,
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)]
pub struct GlobalName(u32);
impl GlobalName {
pub fn from_raw(id: u32) -> Self {
Self(id)
}
pub fn raw(self) -> u32 {
self.0
}
}
impl Display for GlobalName {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
Display::fmt(&self.0, f)
}
}
pub trait GlobalBase {
fn name(&self) -> GlobalName;
fn bind<'a>(
@ -275,7 +252,7 @@ impl Globals {
removed: CopyHashMap::new(),
outputs: Default::default(),
seats: Default::default(),
singletons: StaticMap::from_fn(|_| GlobalName(0)),
singletons: StaticMap::from_fn(|_| GlobalName::from_raw(0)),
exposed: Default::default(),
};
add_singletons(&mut slf);
@ -293,7 +270,7 @@ impl Globals {
if id == 0 {
panic!("Global names overflowed");
}
GlobalName(id)
GlobalName::from_raw(id)
}
fn insert_no_broadcast<'a>(&'a self, global: Rc<dyn Global>) {