[−][src]Trait skyway_webrtc_gateway_api::prelude::SerializableSocket
This trait is for serializing SocketInfo to JSON.
It also has some getter functions.
Required methods
fn new(id: Option<String>, socket: SocketAddr) -> Self
Create an instance of SerializableSocket
fn try_create(id: Option<String>, ip: &str, port: u16) -> Result<Self, Error> where
Self: Sized,
Self: Sized,
Create an instance of SerializableSocket.
Failures
It returns error, if the ip and port is not valid for SocketAddr.
fn get_id(&self) -> Option<T>
Returns id field.
fn key(&self) -> &'static str
Field name of Json.
fn ip(&self) -> IpAddr
Returns IpAddr of the socket.
fn port(&self) -> u16
Returns port number of the socket.