search for: partialeq

Displaying 8 results from an estimated 8 matches for "partialeq".

2019 Aug 05
1
Re: [PATCH 1/2] Rust bindings: Add Event structs, Clarify Handle lifetime
...; guestfs.rs has: use crate::base::*; So it means rust allows cyclic uses of modules/crates? > diff --git a/rust/src/event.rs b/rust/src/event.rs > new file mode 100644 > index 000000000..c363e913a > --- /dev/null > +++ b/rust/src/event.rs > @@ -0,0 +1,4 @@ > +#[derive(Hash, PartialEq, Eq)] > +pub struct EventHandle { > + eh: i32, > +} Remember the copyright/license in new files. -- Pino Toscano
2019 Aug 05
3
Re: [PATCH] Rust bindings: Implement Event features
I fixed based on comments. I'll send these two patches to this mailing list. - Fix Handle -> Handle<'a> - Add events Regards, Hiroyuki 2019年8月1日(木) 0:01 Pino Toscano <ptoscano@redhat.com>: > Hi Hiroyuki, > > On Tuesday, 30 July 2019 07:51:37 CEST Hiroyuki Katsura wrote: > > This patch includes: > > > > - Event callback handlers > > -
2019 Aug 05
0
[PATCH 1/2] Rust bindings: Add Event structs, Clarify Handle lifetime
...let c_msg = unsafe { guestfs_last_error(self.g) }; let message = unsafe { utils::char_ptr_to_string(c_msg).unwrap() }; diff --git a/rust/src/event.rs b/rust/src/event.rs new file mode 100644 index 000000000..c363e913a --- /dev/null +++ b/rust/src/event.rs @@ -0,0 +1,4 @@ +#[derive(Hash, PartialEq, Eq)] +pub struct EventHandle { + eh: i32, +} diff --git a/rust/src/lib.rs b/rust/src/lib.rs index cc41a99f8..81adef2a3 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -18,9 +18,11 @@ mod base; mod error; +mod event; mod guestfs; mod utils; pub use crate::base::*; pub use crate::...
2019 Jul 30
0
Re: [PATCH] Rust bindings: Implement Event features
...+ flags: i32, >+ opaque: *const c_void, >+ ) -> i32; >+ fn guestfs_delete_event_callback(g: *const base::guestfs_h, eh: i32); >+ fn guestfs_event_to_string(bitmask: u64) -> *const c_char; >+ fn free(buf: *const c_void); >+} >+ >+#[derive(Hash, PartialEq, Eq)] >+pub struct EventHandle { >+ eh: i32, >+} >+ >+pub type Callback = FnMut(guestfs::Event, EventHandle, &[i8], &[u64]); >+ >+fn events_to_bitmask(v: &[guestfs::Event]) -> u64 { >+ let mut r = 0u64; >+ for x in v.iter() { >+ r |= x.to...
2019 Jul 30
4
[PATCH] Rust bindings: Implement Event features
...k, + event_bitmask: u64, + flags: i32, + opaque: *const c_void, + ) -> i32; + fn guestfs_delete_event_callback(g: *const base::guestfs_h, eh: i32); + fn guestfs_event_to_string(bitmask: u64) -> *const c_char; + fn free(buf: *const c_void); +} + +#[derive(Hash, PartialEq, Eq)] +pub struct EventHandle { + eh: i32, +} + +pub type Callback = FnMut(guestfs::Event, EventHandle, &[i8], &[u64]); + +fn events_to_bitmask(v: &[guestfs::Event]) -> u64 { + let mut r = 0u64; + for x in v.iter() { + r |= x.to_u64(); + } + r +} + +pub fn event...
2019 Jul 30
1
Re: [PATCH] Rust bindings: Implement Event features
...paque: *const c_void, > >+ ) -> i32; > >+ fn guestfs_delete_event_callback(g: *const base::guestfs_h, eh: i32); > >+ fn guestfs_event_to_string(bitmask: u64) -> *const c_char; > >+ fn free(buf: *const c_void); > >+} > >+ > >+#[derive(Hash, PartialEq, Eq)] > >+pub struct EventHandle { > >+ eh: i32, > >+} > >+ > >+pub type Callback = FnMut(guestfs::Event, EventHandle, &[i8], &[u64]); > >+ > >+fn events_to_bitmask(v: &[guestfs::Event]) -> u64 { > >+ let mut r = 0u64; > >+...
2019 Aug 05
2
[PATCH 2/2] Rust bindings: Implement callback handlers
...k, + event_bitmask: u64, + flags: i32, + opaque: *const c_void, + ) -> i32; + fn guestfs_delete_event_callback(g: *const base::guestfs_h, eh: i32); + fn guestfs_event_to_string(bitmask: u64) -> *const c_char; + fn free(buf: *const c_void); +} + #[derive(Hash, PartialEq, Eq)] pub struct EventHandle { eh: i32, } + +fn events_to_bitmask(v: &[guestfs::Event]) -> u64 { + let mut r = 0u64; + for x in v.iter() { + r |= x.to_u64(); + } + r +} + +pub fn event_to_string(events: &[guestfs::Event]) -> Result<String, error::Error>...
2023 Apr 05
3
[PATCH v2 0/2] rust: virtio: add virtio support
This used to be a single patch, but I split it into two with the addition of struct Scatterlist. Again a bit new with Rust submissions. I was told by Gary Guo to rebase on top of rust-next, but it seems *very* behind? The first patch does not build on its own due to a dead_code warning. It is hard to not have dead code when one is adding infrastructure to be used by others at a later