qemu-rust
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 10/26] rust: qom: move ClassInitImpl to the instance side


From: Zhao Liu
Subject: Re: [PATCH 10/26] rust: qom: move ClassInitImpl to the instance side
Date: Wed, 11 Dec 2024 00:03:31 +0800

On Mon, Dec 09, 2024 at 01:37:01PM +0100, Paolo Bonzini wrote:
> Date: Mon,  9 Dec 2024 13:37:01 +0100
> From: Paolo Bonzini <pbonzini@redhat.com>
> Subject: [PATCH 10/26] rust: qom: move ClassInitImpl to the instance side
> X-Mailer: git-send-email 2.47.1
> 
> Put all traits on the instance struct, which makes it possible to reuse
> class structs if no new virtual methods or class fields are added.
> This is almost always the case for devices (because they are leaf
> classes), which is the primary use case for Rust.
> 
> This is also simpler: soon we will find the implemented methods without
> macros, and this removes the need to go from the class struct to the
> instance struct to find the implementation of the *Impl traits.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  rust/hw/char/pl011/src/device.rs | 4 ++--
>  rust/qemu-api/src/definitions.rs | 8 ++++----
>  rust/qemu-api/tests/tests.rs     | 2 +-
>  3 files changed, 7 insertions(+), 7 deletions(-)

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]