aboutsummaryrefslogtreecommitdiffstats
path: root/rust/fatcat-api/src/models.rs
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-06-30 17:34:22 -0700
committerBryan Newbold <bnewbold@robocracy.org>2018-06-30 17:34:22 -0700
commitf4064c19ec140987e15c64e80a3bf0c70025b31b (patch)
treee89548d5d5f350f65e9c294a34c71a2225a14099 /rust/fatcat-api/src/models.rs
parent3ed7db573438d3620d295813a81237acb91155cb (diff)
downloadfatcat-f4064c19ec140987e15c64e80a3bf0c70025b31b.tar.gz
fatcat-f4064c19ec140987e15c64e80a3bf0c70025b31b.zip
history for container entities
Diffstat (limited to 'rust/fatcat-api/src/models.rs')
-rw-r--r--rust/fatcat-api/src/models.rs69
1 files changed, 4 insertions, 65 deletions
diff --git a/rust/fatcat-api/src/models.rs b/rust/fatcat-api/src/models.rs
index 7ff39789..f33ed9db 100644
--- a/rust/fatcat-api/src/models.rs
+++ b/rust/fatcat-api/src/models.rs
@@ -275,68 +275,7 @@ impl EntityEdit {
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
-pub struct EntityHistory(Vec<EntityHistoryInner>);
-
-impl ::std::convert::From<Vec<EntityHistoryInner>> for EntityHistory {
- fn from(x: Vec<EntityHistoryInner>) -> Self {
- EntityHistory(x)
- }
-}
-
-impl ::std::convert::From<EntityHistory> for Vec<EntityHistoryInner> {
- fn from(x: EntityHistory) -> Self {
- x.0
- }
-}
-
-impl ::std::iter::FromIterator<EntityHistoryInner> for EntityHistory {
- fn from_iter<U: IntoIterator<Item = EntityHistoryInner>>(u: U) -> Self {
- EntityHistory(Vec::<EntityHistoryInner>::from_iter(u))
- }
-}
-
-impl ::std::iter::IntoIterator for EntityHistory {
- type Item = EntityHistoryInner;
- type IntoIter = ::std::vec::IntoIter<EntityHistoryInner>;
-
- fn into_iter(self) -> Self::IntoIter {
- self.0.into_iter()
- }
-}
-
-impl<'a> ::std::iter::IntoIterator for &'a EntityHistory {
- type Item = &'a EntityHistoryInner;
- type IntoIter = ::std::slice::Iter<'a, EntityHistoryInner>;
-
- fn into_iter(self) -> Self::IntoIter {
- (&self.0).into_iter()
- }
-}
-
-impl<'a> ::std::iter::IntoIterator for &'a mut EntityHistory {
- type Item = &'a mut EntityHistoryInner;
- type IntoIter = ::std::slice::IterMut<'a, EntityHistoryInner>;
-
- fn into_iter(self) -> Self::IntoIter {
- (&mut self.0).into_iter()
- }
-}
-
-impl ::std::ops::Deref for EntityHistory {
- type Target = Vec<EntityHistoryInner>;
- fn deref(&self) -> &Self::Target {
- &self.0
- }
-}
-
-impl ::std::ops::DerefMut for EntityHistory {
- fn deref_mut(&mut self) -> &mut Self::Target {
- &mut self.0
- }
-}
-
-#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
-pub struct EntityHistoryInner {
+pub struct EntityHistoryEntry {
#[serde(rename = "edit")]
pub edit: models::EntityEdit,
@@ -347,9 +286,9 @@ pub struct EntityHistoryInner {
pub changelog: models::ChangelogEntry,
}
-impl EntityHistoryInner {
- pub fn new(edit: models::EntityEdit, editgroup: models::Editgroup, changelog: models::ChangelogEntry) -> EntityHistoryInner {
- EntityHistoryInner {
+impl EntityHistoryEntry {
+ pub fn new(edit: models::EntityEdit, editgroup: models::Editgroup, changelog: models::ChangelogEntry) -> EntityHistoryEntry {
+ EntityHistoryEntry {
edit: edit,
editgroup: editgroup,
changelog: changelog,