Displaying 3 results from an estimated 3 matches for "from_utf8".
2019 Aug 05
2
[PATCH 2/2] Rust bindings: Implement callback handlers
...let mut g = guestfs::Handle::create().expect("create");
+ g.set_event_callback(
+ |ev, _, buf, array| {
+ *callback_invoked.borrow_mut() += 1;
+
+ let event = guestfs::event_to_string(&[ev]).unwrap();
+
+ let buf = str::from_utf8(buf).unwrap();
+ let array = array
+ .into_iter()
+ .map(|x| format!("{}", x))
+ .collect::<Vec<String>>()
+ .join(",");
+
+ eprintln!("event logged: event=...
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 Jul 30
4
[PATCH] Rust bindings: Implement Event features
...ct("create");
+ g.set_event_callback(
+ |ev, _, buf, array| {
+ let mut data = (&close_invoked).lock().unwrap();
+ *data += 1;
+
+ let event = guestfs::event_to_string(&[ev]).unwrap();
+
+ let buf = str::from_utf8(buf).unwrap();
+ let array = array
+ .into_iter()
+ .map(|x| format!("{}", x))
+ .collect::<Vec<String>>()
+ .join(",");
+
+ eprintln!("event logged: event=...