pub struct LayerSyncManager { /* private fields */ }Expand description
Manages layer synchronization between local storage and S3
Implementations§
Source§impl LayerSyncManager
impl LayerSyncManager
Sourcepub async fn new(config: LayerStorageConfig) -> Result<Self>
pub async fn new(config: LayerStorageConfig) -> Result<Self>
Create a new sync manager
Sourcepub async fn register_container(
&self,
container_id: ContainerLayerId,
) -> Result<()>
pub async fn register_container( &self, container_id: ContainerLayerId, ) -> Result<()>
Register a container for layer sync tracking
Sourcepub async fn check_for_changes(
&self,
container_id: &ContainerLayerId,
upper_layer_path: impl AsRef<Path>,
) -> Result<bool>
pub async fn check_for_changes( &self, container_id: &ContainerLayerId, upper_layer_path: impl AsRef<Path>, ) -> Result<bool>
Check if a container’s layer has changed and needs sync
Sourcepub async fn sync_layer(
&self,
container_id: &ContainerLayerId,
upper_layer_path: impl AsRef<Path>,
) -> Result<Option<LayerSnapshot>>
pub async fn sync_layer( &self, container_id: &ContainerLayerId, upper_layer_path: impl AsRef<Path>, ) -> Result<Option<LayerSnapshot>>
Create a snapshot and upload it to S3
Sourcepub async fn restore_layer(
&self,
container_id: &ContainerLayerId,
target_path: impl AsRef<Path>,
) -> Result<LayerSnapshot>
pub async fn restore_layer( &self, container_id: &ContainerLayerId, target_path: impl AsRef<Path>, ) -> Result<LayerSnapshot>
Download and restore a layer from S3
Sourcepub async fn list_containers(&self) -> Vec<ContainerLayerId>
pub async fn list_containers(&self) -> Vec<ContainerLayerId>
List all containers with sync state
Sourcepub async fn get_sync_state(
&self,
container_id: &ContainerLayerId,
) -> Option<SyncState>
pub async fn get_sync_state( &self, container_id: &ContainerLayerId, ) -> Option<SyncState>
Get sync state for a container
Auto Trait Implementations§
impl Freeze for LayerSyncManager
impl !RefUnwindSafe for LayerSyncManager
impl Send for LayerSyncManager
impl Sync for LayerSyncManager
impl Unpin for LayerSyncManager
impl !UnwindSafe for LayerSyncManager
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreCreates a shared type from an unshared type.