feat: support opt-in shared reference assignment for host objects
This commit is contained in:
@@ -96,6 +96,14 @@ pub trait ObjectPayload: Any + fmt::Debug + Send + Sync {
|
||||
fn call(&self, _arguments: &[Value]) -> Result<Value, VmError> {
|
||||
Err(VmError::UnsupportedOperation("call"))
|
||||
}
|
||||
|
||||
/// Opt-in shared-reference assignment. Returning true preserves the existing
|
||||
/// object identity after replacing its host-owned target. Ordinary payloads
|
||||
/// return false and retain normal value assignment. Implementations must
|
||||
/// validate before mutation and must not add untraced managed-object edges.
|
||||
fn assign_from(&self, _source: &dyn ObjectPayload) -> Result<bool, VmError> {
|
||||
Ok(false)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Default)]
|
||||
|
||||
Reference in New Issue
Block a user