pub struct RestartCoordinationSocket { /* private fields */ }Expand description
Represents the restart coordination socket, used for communicating with a running oxy process. This is used to trigger a restart and receive notification of its completion or failure.
Implementations§
Source§impl RestartCoordinationSocket
impl RestartCoordinationSocket
Sourcepub fn new(socket: UnixStream) -> Self
pub fn new(socket: UnixStream) -> Self
Create a new RestartCoordinationSocket wrapping a unix socket.
Sourcepub async fn send_restart_command(&mut self) -> RestartResult<u32>
pub async fn send_restart_command(&mut self) -> RestartResult<u32>
Sends a restart command through the socket. Returns Ok(child_pid) on success or an error if the restart failed for any reason.
Sourcepub async fn send_message(&mut self, msg: RestartMessage) -> RestartResult<()>
pub async fn send_message(&mut self, msg: RestartMessage) -> RestartResult<()>
Send a message over the socket
Sourcepub async fn receive_message(&mut self) -> RestartResult<RestartMessage>
pub async fn receive_message(&mut self) -> RestartResult<RestartMessage>
Receive a message from the socket.
Auto Trait Implementations§
impl !Freeze for RestartCoordinationSocket
impl RefUnwindSafe for RestartCoordinationSocket
impl Send for RestartCoordinationSocket
impl Sync for RestartCoordinationSocket
impl Unpin for RestartCoordinationSocket
impl UnwindSafe for RestartCoordinationSocket
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