rust: qom: add initial subset of methods on Object
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 5 Nov 2024 23:01:57 +0000 (00:01 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 19 Dec 2024 18:36:37 +0000 (19:36 +0100)
commitba3b81f3b668d3faa6cbdb39e123394f7bf637c7
tree42d37373c9ad3d1004e2565e7b2e98647f3916d3
parentf50cd85c8475c16374d0e138efda222ce4455f53
rust: qom: add initial subset of methods on Object

Add an example of implementing instance methods and converting the
result back to a Rust type.  In this case the returned types are a
string (actually a Cow<str>; but that's transparent as long as it derefs
to &str) and a QOM class.

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
rust/qemu-api/src/prelude.rs
rust/qemu-api/src/qom.rs
rust/qemu-api/tests/tests.rs