Struct cjdns::Socket
[−]
[src]
pub struct Socket { /* fields omitted */ }
The socket that is used to talk to the cjdroute api
Methods
impl Socket
[src]
fn udp(addr: &str) -> Result<Socket, Error>
Create a new udp socket
fn send(&self, msg: &CjdnsMsg) -> Result<usize, Error>
Send a CjdnsMsg to the socket
fn recv<T: Decodable>(&self) -> Result<T, Error>
Receive an object from the socket
fn send_raw(&self, buf: Vec<u8>) -> Result<usize, Error>
fn recv_raw(&self) -> Result<Vec<u8>, Error>
fn recv_all<T: Decodable>(&self, msg: &mut CjdnsMsg) -> Result<Vec<T>, Error>
Receive a paginated list from the api
fn recv_result<T: Decodable>(&self) -> Result<T, Error> where
T: Debug,
T: Debug,