pub struct LocalStateStore { /* private fields */ }Expand description
Local file-based state store.
Implementations§
Source§impl LocalStateStore
impl LocalStateStore
Sourcepub fn new() -> Result<Self>
pub fn new() -> Result<Self>
Creates a new local state store with default paths.
§Errors
Returns an error if the base directory cannot be determined.
Sourcepub fn with_base_dir(base_dir: impl Into<PathBuf>) -> Self
pub fn with_base_dir(base_dir: impl Into<PathBuf>) -> Self
Creates a new local state store with a custom base directory.
Sourcepub fn with_state_path(state_path: impl Into<PathBuf>) -> Self
pub fn with_state_path(state_path: impl Into<PathBuf>) -> Self
Creates a new local state store from a custom state file path.
Trait Implementations§
Source§impl Debug for LocalStateStore
impl Debug for LocalStateStore
Source§impl StateStore for LocalStateStore
impl StateStore for LocalStateStore
Source§fn load<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<DeploymentState>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<DeploymentState>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Loads the deployment state. Read more
Source§fn save<'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 DeploymentState,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn save<'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 DeploymentState,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Saves the deployment state.
Source§fn delete<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Deletes the deployment state.
Source§fn exists<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn exists<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Checks if state exists.
Source§fn acquire_lock<'life0, 'life1, 'async_trait>(
&'life0 self,
holder: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<LockInfo>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn acquire_lock<'life0, 'life1, 'async_trait>(
&'life0 self,
holder: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<LockInfo>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Acquires a lock on the state. Read more
Source§fn release_lock<'life0, 'life1, 'async_trait>(
&'life0 self,
lock_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn release_lock<'life0, 'life1, 'async_trait>(
&'life0 self,
lock_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Releases a lock on the state.
Source§fn get_lock_info<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<LockInfo>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_lock_info<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<LockInfo>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Gets current lock information if locked.
Source§fn is_locked<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn is_locked<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Checks if the state is locked.
Source§fn backend_type(&self) -> &'static str
fn backend_type(&self) -> &'static str
Gets the backend type name.
Auto Trait Implementations§
impl Freeze for LocalStateStore
impl RefUnwindSafe for LocalStateStore
impl Send for LocalStateStore
impl Sync for LocalStateStore
impl Unpin for LocalStateStore
impl UnwindSafe for LocalStateStore
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.