pub struct SuperBlockManager { /* private fields */ }
Expand description
This encapsulates the A/B alternating super-block logic. All super-block load/save operations should be via the methods on this type.
Implementations§
Source§impl SuperBlockManager
impl SuperBlockManager
pub fn new() -> Self
Sourcepub async fn load(
&self,
device: Arc<dyn Device>,
block_size: u64,
) -> Result<(SuperBlockHeader, ObjectStore), Error>
pub async fn load( &self, device: Arc<dyn Device>, block_size: u64, ) -> Result<(SuperBlockHeader, ObjectStore), Error>
Loads both A/B super-blocks and root_parent ObjectStores and and returns the newest valid pair. Also ensures the next superblock updated via |save| will be the other instance.
Sourcepub async fn save(
&self,
super_block_header: SuperBlockHeader,
filesystem: Arc<FxFilesystem>,
root_parent: LayerSet<ObjectKey, ObjectValue>,
) -> Result<(), Error>
pub async fn save( &self, super_block_header: SuperBlockHeader, filesystem: Arc<FxFilesystem>, root_parent: LayerSet<ObjectKey, ObjectValue>, ) -> Result<(), Error>
Writes the provided superblock and root_parent ObjectStore to the device. Requires that the filesystem is fully loaded and writable as this may require allocation.
Auto Trait Implementations§
impl Freeze for SuperBlockManager
impl !RefUnwindSafe for SuperBlockManager
impl Send for SuperBlockManager
impl Sync for SuperBlockManager
impl Unpin for SuperBlockManager
impl !UnwindSafe for SuperBlockManager
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
Source§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§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>
Converts
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>
Converts
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