pub struct FlockPidLockManager { /* private fields */ }Implementations§
Source§impl FlockPidLockManager
impl FlockPidLockManager
Sourcepub fn new(datadir: impl Into<PathBuf>) -> Result<Self, PidLockError>
pub fn new(datadir: impl Into<PathBuf>) -> Result<Self, PidLockError>
Take the pid lock on datadir and construct a manager. Fails
with PidLockError::AlreadyHeld if another process already
holds the lock, or PidLockError::SetupFailed for any other
I/O failure.
pub fn datadir(&self) -> &Path
Trait Implementations§
Source§impl Debug for FlockPidLockManager
impl Debug for FlockPidLockManager
Source§impl LockManager for FlockPidLockManager
impl LockManager for FlockPidLockManager
Source§fn try_lock<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Option<Box<dyn LockGuard>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn try_lock<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Option<Box<dyn LockGuard>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Try to acquire the named lock without waiting. Returns
None if
it is already held, the key is rejected by [validate_key], or
the backend cannot acquire the lock for any other reason.Auto Trait Implementations§
impl Freeze for FlockPidLockManager
impl RefUnwindSafe for FlockPidLockManager
impl Send for FlockPidLockManager
impl Sync for FlockPidLockManager
impl Unpin for FlockPidLockManager
impl UnsafeUnpin for FlockPidLockManager
impl UnwindSafe for FlockPidLockManager
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request