pub struct RootVolume { /* private fields */ }
Expand description
RootVolume is the top-level volume which stores references to all of the other Volumes.
Implementations§
Source§impl RootVolume
impl RootVolume
pub fn volume_directory(&self) -> &Directory<ObjectStore>
Sourcepub async fn new_volume(
&self,
volume_name: &str,
options: NewChildStoreOptions,
) -> Result<Arc<ObjectStore>, Error>
pub async fn new_volume( &self, volume_name: &str, options: NewChildStoreOptions, ) -> Result<Arc<ObjectStore>, Error>
Creates a new volume under a transaction lock.
Sourcepub async fn volume(
&self,
volume_name: &str,
options: StoreOptions,
) -> Result<Arc<ObjectStore>, Error>
pub async fn volume( &self, volume_name: &str, options: StoreOptions, ) -> Result<Arc<ObjectStore>, Error>
Returns the volume with the given name. This is not thread-safe.
Sourcepub async fn delete_volume(
&self,
volume_name: &str,
transaction: Transaction<'_>,
callback: impl FnOnce() + Send,
) -> Result<(), Error>
pub async fn delete_volume( &self, volume_name: &str, transaction: Transaction<'_>, callback: impl FnOnce() + Send, ) -> Result<(), Error>
Deletes the given volume. Consumes transaction
and runs callback
during commit. The
caller must have the correct locks for the volumes directory.
Sourcepub async fn install_volume(
&self,
src: &str,
image_file: &str,
dst: &str,
) -> Result<(), Error>
pub async fn install_volume( &self, src: &str, image_file: &str, dst: &str, ) -> Result<(), Error>
Attempts to install the image image_file
in the volume src
as the volume dst
. The
image file should be an fxfs partition image containing a volume matching the name dst
.
The contents of the dst
volume in the image will be installed in-place into this
filesystem, replacing an existing dst
volume if one exists.
There can be no other objects in src
with extent records, and neither src
nor dst
can
be encrypted.
Sourcepub async fn acquire_transaction_for_remove_volume(
&self,
name: &str,
extra_keys: impl IntoIterator<Item = LockKey>,
allow_not_found: bool,
) -> Result<(u64, Transaction<'_>), Error>
pub async fn acquire_transaction_for_remove_volume( &self, name: &str, extra_keys: impl IntoIterator<Item = LockKey>, allow_not_found: bool, ) -> Result<(u64, Transaction<'_>), Error>
Acquires a transaction with appropriate locks to remove volume |name|. Also returns the object ID of the store which will be deleted.
Auto Trait Implementations§
impl !Freeze for RootVolume
impl !RefUnwindSafe for RootVolume
impl Send for RootVolume
impl Sync for RootVolume
impl Unpin for RootVolume
impl !UnwindSafe for RootVolume
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
§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more