pub struct DataStoreCoordinator { /* private fields */ }Expand description
Host-facing, fenced write coordinator governed by Spec 093.
Implementations§
Source§impl DataStoreCoordinator
impl DataStoreCoordinator
pub fn new() -> Self
Sourcepub fn acquire(&self, owner: &str) -> Result<u64, DataStoreCoordinatorError>
pub fn acquire(&self, owner: &str) -> Result<u64, DataStoreCoordinatorError>
Acquires the exclusive writer lease for owner and returns its generation.
§Errors
Returns DataStoreCoordinatorError::OwnerLocked when another owner holds
the lease, or DataStoreCoordinatorError::CoordinatorUnavailable when
the coordinator state is unavailable or cannot issue another generation.
Sourcepub fn validate(
&self,
owner: &str,
generation: u64,
) -> Result<(), DataStoreCoordinatorError>
pub fn validate( &self, owner: &str, generation: u64, ) -> Result<(), DataStoreCoordinatorError>
Validates that owner still holds the supplied lease generation.
§Errors
Returns DataStoreCoordinatorError::OwnerLocked when the owner or
generation is stale, or DataStoreCoordinatorError::CoordinatorUnavailable
when the coordinator state is unavailable.
Sourcepub fn release(
&self,
owner: &str,
generation: u64,
) -> Result<(), DataStoreCoordinatorError>
pub fn release( &self, owner: &str, generation: u64, ) -> Result<(), DataStoreCoordinatorError>
Releases the exclusive writer lease held by owner at generation.
§Errors
Returns DataStoreCoordinatorError::OwnerLocked when the owner or
generation is stale, or DataStoreCoordinatorError::CoordinatorUnavailable
when the coordinator state is unavailable.
Trait Implementations§
Source§impl Clone for DataStoreCoordinator
impl Clone for DataStoreCoordinator
Source§fn clone(&self) -> DataStoreCoordinator
fn clone(&self) -> DataStoreCoordinator
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DataStoreCoordinator
impl Debug for DataStoreCoordinator
Auto Trait Implementations§
impl Freeze for DataStoreCoordinator
impl RefUnwindSafe for DataStoreCoordinator
impl Send for DataStoreCoordinator
impl Sync for DataStoreCoordinator
impl Unpin for DataStoreCoordinator
impl UnsafeUnpin for DataStoreCoordinator
impl UnwindSafe for DataStoreCoordinator
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
self file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: Sized + AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: Sized + AsFilelike,
self file descriptor. Read moreSource§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> ⓘ
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