feat: add managed types, source classes and scoped native calls

This commit is contained in:
2026-10-21 01:47:08 +08:00
parent 7c842789c0
commit a970fd7707
48 changed files with 2069 additions and 134 deletions
+26
View File
@@ -0,0 +1,26 @@
use crate::ObjectRef;
/// A precise field change or a replacement of an object's native contents.
/// Entries are notifications, never roots; a source can be dead when consumed.
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)]
pub enum ChangeKey {
Attribute(String),
Contents,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ObjectChange {
pub object: ObjectRef,
pub key: ChangeKey,
pub version: u64,
}
/// Coalesced changes since the previous drain. Overflow requires the consumer
/// to rescan its dependencies, rather than silently missing notifications.
#[derive(Debug, Default)]
pub struct ChangeBatch {
pub changes: Vec<ObjectChange>,
pub rescan_required: bool,
}
pub(crate) const MAX_PENDING_CHANGES: usize = 4096;