MCPcopy Create free account
hub / github.com/Apress/beginning-rust-2e / create

Method create

Source Code/20-01.rs:21–27  ·  view source on GitHub ↗
(address: &str, port: u16)

Source from the content-addressed store, hash-verified

19 }
20 impl CommunicationChannel {
21 fn create(address: &str, port: u16) -> CommunicationChannel {
22 println!("Opening port {}:{}", address, port);
23 CommunicationChannel {
24 address: address.to_string(),
25 port: port,
26 }
27 }
28 fn send(&self, msg: &str) {
29 println!("Sent to {}:{} the message '{}'",
30 self.address, self.port, msg);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected