pub struct AdminClient { /* private fields */ }Expand description
Subscriber for the inferd admin socket.
Construct via dial_admin_uds (Unix) / dial_admin_pipe
(Windows). Read events with recv() or wait for a specific
state with wait_ready().
Implementations§
Source§impl AdminClient
impl AdminClient
Sourcepub async fn dial_admin_uds(path: &Path) -> Result<Self, AdminError>
pub async fn dial_admin_uds(path: &Path) -> Result<Self, AdminError>
Open a Unix domain socket connection to the admin socket (Unix only).
Sourcepub async fn recv(&mut self) -> Result<AdminEvent, AdminError>
pub async fn recv(&mut self) -> Result<AdminEvent, AdminError>
Read the next admin event. Blocks until a frame arrives or the daemon closes the connection.
Sourcepub async fn wait_ready(&mut self) -> Result<AdminEvent, AdminError>
pub async fn wait_ready(&mut self) -> Result<AdminEvent, AdminError>
Loop recv() until a ready event arrives. Returns the
event that flipped state. Returns Err(AdminError::Closed)
if the daemon closes before reaching ready (a daemon that
crashes mid-load looks like this).
Auto Trait Implementations§
impl Freeze for AdminClient
impl !RefUnwindSafe for AdminClient
impl Send for AdminClient
impl !Sync for AdminClient
impl Unpin for AdminClient
impl UnsafeUnpin for AdminClient
impl !UnwindSafe for AdminClient
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