Struct erl_dist::epmd::EpmdClient

source ·
pub struct EpmdClient<T> { /* private fields */ }
Expand description

EPMD client.

Implementations§

source§

impl<T> EpmdClient<T>where T: AsyncRead + AsyncWrite + Unpin,

source

pub fn new(connection: T) -> Self

Makes a new EpmdClient instance.

connection is a connection to communicate with the target EPMD server.

source

pub async fn register(self, node: NodeEntry) -> Result<(T, Creation), EpmdError>

Registers a node in EPMD.

The connection created to the EPMD must be kept as long as the node is a distributed node. When the connection is closed, the node is automatically unregistered from the EPMD.

source

pub async fn get_names(self) -> Result<Vec<(String, u16)>, EpmdError>

Gets all registered nodes (name and port pairs) from EPMD.

source

pub async fn get_node( self, node_name: &str ) -> Result<Option<NodeEntry>, EpmdError>

Queries the node which has the given name to EPMD.

If the node has not been registered in the connected EPMD, this method will return None.

source

pub async fn kill(self) -> Result<String, EpmdError>

Kills EPMD.

This request kills the running EPMD. It is almost never used.

If EPMD is killed, this method returns "OK".

source

pub async fn dump(self) -> Result<String, EpmdError>

Dumps all data from EPMD.

This request is not really used, it is to be regarded as a debug feature.

The result value is a string written for each node kept in the connected EPMD.

The format of each entry is

"active name ${NODE_NAME} at port ${PORT}, fd = ${FD}\n"

or

"old/unused name ${NODE_NAME} at port ${PORT}, fd = ${FD}\n"

Trait Implementations§

source§

impl<T: Debug> Debug for EpmdClient<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<T> RefUnwindSafe for EpmdClient<T>where T: RefUnwindSafe,

§

impl<T> Send for EpmdClient<T>where T: Send,

§

impl<T> Sync for EpmdClient<T>where T: Sync,

§

impl<T> Unpin for EpmdClient<T>where T: Unpin,

§

impl<T> UnwindSafe for EpmdClient<T>where T: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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> TryAsRef<T> for T

source§

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

§

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 Twhere U: TryFrom<T>,

§

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.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V