Skip to content

Commit 6acc672

Browse files
committed
StorageOpenOptions: Add getters
Allow reading set options from `StorageOpenOptions`, which will be useful for “implicit open gates” to check what options a storage object is to be opened with. Signed-off-by: Hanna Czenczek <hreitz@redhat.com> (cherry picked from commit e4a524f) Signed-off-by: Hanna Czenczek <hreitz@redhat.com>
1 parent a3f9e54 commit 6acc672

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/storage/mod.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,4 +532,19 @@ impl StorageOpenOptions {
532532
self.direct = direct;
533533
self
534534
}
535+
536+
/// Get the set filename (if any).
537+
pub fn get_filename(&self) -> Option<&Path> {
538+
self.filename.as_deref()
539+
}
540+
541+
/// Return the set writable state.
542+
pub fn get_writable(&self) -> bool {
543+
self.writable
544+
}
545+
546+
/// Return the set direct state.
547+
pub fn get_direct(&self) -> bool {
548+
self.direct
549+
}
535550
}

0 commit comments

Comments
 (0)