kaspa_wrpc_client/
node.rs1use crate::imports::*;
4
5#[derive(Clone, Debug, Serialize, Deserialize)]
12#[wasm_bindgen(inspectable)]
13pub struct NodeDescriptor {
14 #[wasm_bindgen(getter_with_clone)]
16 pub uid: String,
17 #[wasm_bindgen(getter_with_clone)]
19 pub url: String,
20}
21
22impl Eq for NodeDescriptor {}
23
24impl PartialEq for NodeDescriptor {
25 fn eq(&self, other: &Self) -> bool {
26 self.url == other.url
27 }
28}
29
30impl std::fmt::Display for NodeDescriptor {
31 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
32 write!(f, "{}", self.url)
33 }
34}
35
36impl NodeDescriptor {
37 pub fn url(&self) -> String {
38 self.url.clone()
39 }
40}