Fix V2/V3 messaging ABI-break

This commit is contained in:
Sebastian committed 2026-08-13 09:49:57 +02:00
1 parent 29c41a4041
commit 883e703b02
7 files changed
+179 -38

No files matched your search

+10 -6
View File
@@ -395,12 +395,6 @@ pub trait HostApi {
/// Add an entity to the active document, returning its handle.
fn add_entity(&mut self, entity: EntityType) -> Handle;
/// Add multiple entities to the active document, returning their handles.
/// The default implementation calls [`add_entity`](Self::add_entity) for each
/// entity; hosts should override it for batch efficiency.
fn add_entities(&mut self, entities: Vec<EntityType>) -> Vec<Handle> {
entities.into_iter().map(|e| self.add_entity(e)).collect()
}
/// Replace the existing entity that carries `entity`'s handle, preserving
/// its identity (handle and owning block). Returns `false` when no entity
/// has that handle. This is the sanctioned way to commit in-place edits
@@ -519,6 +513,16 @@ pub trait HostApi {
fn close_document_view_v4(&mut self, tab_id: u64) {
let _ = tab_id;
}
// ── Batch entities (added after API v4; appended at the very end so older
// plugins compiled without it keep stable vtable indices) ────────────────
/// Add multiple entities to the active document, returning their handles.
/// The default implementation calls [`add_entity`](Self::add_entity) for each
/// entity; hosts should override it for batch efficiency.
fn add_entities(&mut self, entities: Vec<EntityType>) -> Vec<Handle> {
entities.into_iter().map(|e| self.add_entity(e)).collect()
}
}
/// Simplified, read-only entity kind exposed by [`DocumentReader`].