pub struct FormatDriverBuilderBase<S: Storage> {
image: StorageOrPath<S>,
writable: bool,
storage_opts: Option<StorageOpenOptions>,
}
Expand description
Image open builder with the most basic options.
Fields§
§image: StorageOrPath<S>
Metadata (image) file
writable: bool
Whether the image is writable or not
storage_opts: Option<StorageOpenOptions>
Options to be used for implicitly opened storage
Implementations§
Source§impl<S: Storage> FormatDriverBuilderBase<S>
impl<S: Storage> FormatDriverBuilderBase<S>
Sourcefn do_new(image: StorageOrPath<S>) -> Self
fn do_new(image: StorageOrPath<S>) -> Self
Create a new instance of this type.
Sourcepub fn new(image: S) -> Self
pub fn new(image: S) -> Self
Helper for FormatDriverBuilder::new()
.
Sourcepub fn new_path<P: AsRef<Path>>(path: P) -> Self
pub fn new_path<P: AsRef<Path>>(path: P) -> Self
Helper for FormatDriverBuilder::new_path()
.
Sourcepub fn set_write(&mut self, writable: bool)
pub fn set_write(&mut self, writable: bool)
Helper for FormatDriverBuilder::write()
.
Sourcepub fn set_storage_open_options(&mut self, options: StorageOpenOptions)
pub fn set_storage_open_options(&mut self, options: StorageOpenOptions)
Helper for FormatDriverBuilder::storage_open_options()
.
Sourcepub fn get_image_path(&self) -> Option<PathBuf>
pub fn get_image_path(&self) -> Option<PathBuf>
If possible, get the image’s path.
Sourcepub fn get_writable(&self) -> bool
pub fn get_writable(&self) -> bool
Return the set writable state.
Sourcepub fn get_storage_opts(&self) -> Option<&StorageOpenOptions>
pub fn get_storage_opts(&self) -> Option<&StorageOpenOptions>
Return the set storage options (if any).
Sourcepub fn make_storage_opts(&self) -> StorageOpenOptions
pub fn make_storage_opts(&self) -> StorageOpenOptions
Create storage options.
If any were set, return those, overriding their writable state based on the set writable
state (FormatDriverBuilderBase::set_write()
). Otherwise, create an empty set (again
with the writable state set as appropriate).
Sourcepub async fn open_image<G: ImplicitOpenGate<S>>(self, gate: &mut G) -> Result<S>
pub async fn open_image<G: ImplicitOpenGate<S>>(self, gate: &mut G) -> Result<S>
Open the image’s storage object.
Auto Trait Implementations§
impl<S> Freeze for FormatDriverBuilderBase<S>where
S: Freeze,
impl<S> RefUnwindSafe for FormatDriverBuilderBase<S>where
S: RefUnwindSafe,
impl<S> Send for FormatDriverBuilderBase<S>
impl<S> Sync for FormatDriverBuilderBase<S>
impl<S> Unpin for FormatDriverBuilderBase<S>where
S: Unpin,
impl<S> UnwindSafe for FormatDriverBuilderBase<S>where
S: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more