fn extendable(&self) -> bool { true }
}
-struct SingletonSource {
- id: String,
+struct StaticSource {
+ ids: Vec<String>,
}
-impl SingletonSource {
- fn new(id: String) -> Self { SingletonSource { id } }
+impl StaticSource {
+ fn singleton(id: String) -> Self { StaticSource { ids: vec! { id } } }
+ fn vector(ids: Vec<String>) -> Self { StaticSource { ids } }
}
-impl FileDataSource for SingletonSource {
+impl FileDataSource for StaticSource {
fn get(&self, _client: &mut Client) -> (Vec<String>, isize) {
- (vec! { self.id.clone() }, 0)
+ (self.ids.clone(), 0)
}
fn init(&self, _client: &mut Client) -> Result<(), ClientError> { Ok(()) }
fn try_extend(&self, _client: &mut Client) -> Result<bool, ClientError> {
&format!("Information about user {username}"), 'H');
let file = File::<ExamineUserFileType, _>::new(
- client, SingletonSource::new(ac.id), title)?;
+ client, StaticSource::singleton(ac.id), title)?;
Ok(Box::new(file))
}
&format!("Information about post {}", st.id), 'H');
let file = File::<DetailedStatusFileType, _>::new(
- client, SingletonSource::new(st.id), title)?;
+ client, StaticSource::singleton(st.id), title)?;
Ok(Box::new(file))
}