feat: add managed types, source classes and scoped native calls
This commit is contained in:
@@ -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;
|
||||
Reference in New Issue
Block a user