Struct mz_pid_file::PidFile
source · pub struct PidFile(/* private fields */);
Expand description
An open PID file.
A process that manages to construct this type holds an exclusive lock on the PID file.
Dropping the type will attempt to call remove
, but any
errors will be suppressed. Call remove
manually if you need to handle PID
file removal errors.
Implementations§
source§impl PidFile
impl PidFile
sourcepub fn open<P>(path: P) -> Result<PidFile, Error>
pub fn open<P>(path: P) -> Result<PidFile, Error>
Attempts to open and lock the specified PID file.
If the file is already locked by another process, it returns
Error::AlreadyRunning
.
sourcepub fn open_with<P>(path: P, permissions: Permissions) -> Result<PidFile, Error>
pub fn open_with<P>(path: P, permissions: Permissions) -> Result<PidFile, Error>
Like open
, but opens the file with the specified
permissions rather than 0600.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PidFile
impl RefUnwindSafe for PidFile
impl !Send for PidFile
impl !Sync for PidFile
impl Unpin for PidFile
impl UnwindSafe for PidFile
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> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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