aboutsummaryrefslogtreecommitdiffstats
path: root/src/xchan.rs
diff options
context:
space:
mode:
authorYour Name <you@example.com>2020-05-02 10:49:23 +0200
committerYour Name <you@example.com>2020-05-02 10:51:24 +0200
commit73f4ff61c4d3dc8c70d048c71bb23651c460c107 (patch)
tree36a06f8912fe70655e17abbcf939c087fdb75eb2 /src/xchan.rs
parent80fcbb4f1dd8cc0f179be463c14312aceba0b42f (diff)
downloadrust-zotapi-73f4ff61c4d3dc8c70d048c71bb23651c460c107.tar.gz
rust-zotapi-73f4ff61c4d3dc8c70d048c71bb23651c460c107.tar.bz2
rust-zotapi-73f4ff61c4d3dc8c70d048c71bb23651c460c107.zip
xchan: rename request object type to XChanRequest.
We want to have the XChan type for actial XChan data.
Diffstat (limited to 'src/xchan.rs')
-rw-r--r--src/xchan.rs24
1 files 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<XChanSelector<'a>>,
+pub struct XChanRequest<'a> {
+ data: Option<XChanRequestSelector<'a>>,
}
-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
}