Skip to main content

AdminClient

Struct AdminClient 

Source
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

Source

pub async fn dial_admin_uds(path: &Path) -> Result<Self, AdminError>

Open a Unix domain socket connection to the admin socket (Unix only).

Source

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.

Source

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§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.