pub trait SerializableSocket<T> {
    fn try_create(id: Option<String>, ip: &str, port: u16) -> Result<Self, Error>
    where
        Self: Sized
; fn get_id(&self) -> Option<T>; fn key(&self) -> &'static str; fn addr(&self) -> &SocketAddr; fn ip(&self) -> IpAddr; fn port(&self) -> u16; }
Expand description

This trait is for serializing SocketInfo to JSON.

It also has some getter functions.

Required Methods

Create an instance of SerializableSocket.

Failures

It returns error, if the ip and port is not valid for SocketAddr.

Returns id field.

Field name of Json.

Returns SocketAddr of the socket.

Returns IpAddr of the socket.

Returns port number of the socket.

Implementors