Displaying 4 results from an estimated 4 matches for "c363e913a".
2019 Aug 05
1
Re: [PATCH 1/2] Rust bindings: Add Event structs, Clarify Handle lifetime
...6 +17,9 @@
> */
>
> use crate::error;
> +use crate::event;
> +use crate::guestfs;
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
...ror_from_handle(&self, operation: &'static str) -> Error {
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;
+...
2019 Aug 05
2
[PATCH 2/2] Rust bindings: Implement callback handlers
...::last_os_error(), operation)
+}
+
impl<'a> base::Handle<'a> {
pub(crate) fn get_error_from_handle(&self, operation: &'static str) -> Error {
let c_msg = unsafe { guestfs_last_error(self.g) };
diff --git a/rust/src/event.rs b/rust/src/event.rs
index c363e913a..752e73610 100644
--- a/rust/src/event.rs
+++ b/rust/src/event.rs
@@ -1,4 +1,150 @@
+/* libguestfs Rust bindings
+ * Copyright (C) 2019 Hiroyuki Katsura <hiroyuki.katsura.0513@gmail.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the...