From 73f4ff61c4d3dc8c70d048c71bb23651c460c107 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 2 May 2020 10:49:23 +0200 Subject: xchan: rename request object type to XChanRequest. We want to have the XChan type for actial XChan data. --- src/xchan.rs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/xchan.rs b/src/xchan.rs index 2e42c39..1a5fadc 100644 --- a/src/xchan.rs +++ b/src/xchan.rs @@ -20,33 +20,33 @@ use serde::Serialize; #[derive(Debug, Serialize)] #[serde(rename_all = "lowercase")] -enum XChanSelector<'a> { +enum XChanRequestSelector<'a> { Address(&'a str), Hash(&'a str), GUID(&'a str), } -pub struct XChan<'a> { - data: Option>, +pub struct XChanRequest<'a> { + data: Option>, } -pub fn xchan<'a>() -> XChan<'a> { - XChan { data: None } +pub fn xchan<'a>() -> XChanRequest<'a> { + XChanRequest { data: None } } -impl<'a> XChan<'a> { - pub fn by_address(&mut self, addr: &'a str) -> &mut XChan<'a> { - self.data = Some(XChanSelector::Address(addr)); +impl<'a> XChanRequest<'a> { + pub fn by_address(&mut self, addr: &'a str) -> &mut XChanRequest<'a> { + self.data = Some(XChanRequestSelector::Address(addr)); self } - pub fn by_hash(&mut self, hash: &'a str) -> &mut XChan<'a> { - self.data = Some(XChanSelector::Hash(hash)); + pub fn by_hash(&mut self, hash: &'a str) -> &mut XChanRequest<'a> { + self.data = Some(XChanRequestSelector::Hash(hash)); self } - pub fn by_guid(&mut self, guid: &'a str) -> &mut XChan<'a> { - self.data = Some(XChanSelector::GUID(guid)); + pub fn by_guid(&mut self, guid: &'a str) -> &mut XChanRequest<'a> { + self.data = Some(XChanRequestSelector::GUID(guid)); self } -- cgit v1.2.3