diff options
author | David Blajda <blajda@hotmail.com> | 2018-12-27 02:29:37 +0000 |
---|---|---|
committer | David Blajda <blajda@hotmail.com> | 2018-12-27 02:29:37 +0000 |
commit | 2e08d0c8abbfb9f989c61acb4f6c580719a65b42 (patch) | |
tree | 854c916b2ac6370c58308c70fc094978a23cbc67 /src/helix/models.rs | |
parent | adcc342c9c1674ce88ebaf7f9359bde9665ca3f8 (diff) |
:Allow iteration over endpoints that provide pagination
Diffstat (limited to 'src/helix/models.rs')
-rw-r--r-- | src/helix/models.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/helix/models.rs b/src/helix/models.rs index bdb8438..4124fd2 100644 --- a/src/helix/models.rs +++ b/src/helix/models.rs @@ -7,7 +7,6 @@ use super::types::{UserId, VideoId, ChannelId}; pub trait PaginationTrait { fn cursor<'a>(&'a self) -> &'a Option<Cursor>; - fn set_request(&mut self); } #[derive(Debug, Deserialize)] @@ -17,17 +16,14 @@ pub struct DataContainer<T> { impl<T> PaginationTrait for DataContainer<T> { fn cursor<'a>(&'a self) -> &'a Option<Cursor> { &None } - fn set_request(&mut self) {} } impl<T> PaginationTrait for PaginationContainer<T> { fn cursor<'a>(&'a self) -> &'a Option<Cursor> { &self.pagination } - fn set_request(&mut self) {} } impl PaginationTrait for Credentials { fn cursor<'a>(&'a self) -> &'a Option<Cursor> { &None } - fn set_request(&mut self) {} } #[derive(Debug, Deserialize)] @@ -38,9 +34,10 @@ pub struct PaginationContainer<T> { #[derive(Debug, Deserialize)] pub struct Cursor { - cursor: String + pub cursor: Option<String> } + #[derive(Debug, Deserialize)] pub struct Credentials { pub access_token: String, |