DevelopmentNodeEnvironment_MicrosoftVSCodeDependency_22NodeVersion_Bundle_Clean_Debug_ElectronProfile_EsbuildCompiler_Mountain/IPC/Common/ServiceInfo/
ServiceEndpoint.rs1use serde::{Deserialize, Serialize};
6
7#[derive(Debug, Clone, Serialize, Deserialize)]
8pub struct Struct {
9 pub Protocol:String,
10
11 pub Address:String,
12
13 pub Port:u16,
14
15 pub Path:Option<String>,
16}
17
18impl Struct {
19 pub fn new(Protocol:impl Into<String>, Address:impl Into<String>, Port:u16) -> Self {
20 Self { Protocol:Protocol.into(), Address:Address.into(), Port, Path:None }
21 }
22
23 pub fn NewUnix(Path:impl Into<String>) -> Self {
24 Self {
25 Protocol:"unix".to_string(),
26
27 Address:String::new(),
28
29 Port:0,
30
31 Path:Some(Path.into()),
32 }
33 }
34}