imago/qcow2/
sync_wrappers.rs1use super::*;
4
5impl<S: Storage + 'static, F: WrappedFormat<S> + 'static> Qcow2<S, F> {
6 pub fn open_image_sync(metadata: S, writable: bool) -> io::Result<Self> {
10 tokio::runtime::Builder::new_current_thread()
11 .build()?
12 .block_on(Self::open_image(metadata, writable))
13 }
14
15 pub fn open_path_sync<P: AsRef<Path>>(path: P, writable: bool) -> io::Result<Self> {
19 tokio::runtime::Builder::new_current_thread()
20 .build()?
21 .block_on(Self::open_path(path, writable))
22 }
23
24 pub fn open_implicit_dependencies_sync(&mut self) -> io::Result<()> {
28 tokio::runtime::Builder::new_current_thread()
29 .build()?
30 .block_on(self.open_implicit_dependencies())
31 }
32}