2015-09-24 03:02:28 +00:00
|
|
|
use super::Endpoint;
|
|
|
|
|
2017-10-20 19:18:40 +00:00
|
|
|
use SupportedFormat;
|
2015-09-24 03:02:28 +00:00
|
|
|
|
|
|
|
use std::vec::IntoIter as VecIntoIter;
|
|
|
|
|
|
|
|
pub struct EndpointsIterator(bool);
|
|
|
|
|
2017-10-11 11:24:49 +00:00
|
|
|
unsafe impl Send for EndpointsIterator {
|
|
|
|
}
|
|
|
|
unsafe impl Sync for EndpointsIterator {
|
|
|
|
}
|
2015-09-24 03:02:28 +00:00
|
|
|
|
|
|
|
impl Default for EndpointsIterator {
|
|
|
|
fn default() -> Self {
|
|
|
|
EndpointsIterator(false)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Iterator for EndpointsIterator {
|
|
|
|
type Item = Endpoint;
|
|
|
|
fn next(&mut self) -> Option<Endpoint> {
|
2017-10-11 11:24:49 +00:00
|
|
|
if self.0 {
|
|
|
|
None
|
|
|
|
} else {
|
|
|
|
self.0 = true;
|
|
|
|
Some(Endpoint)
|
|
|
|
}
|
2015-09-24 03:02:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-10-12 09:54:09 +00:00
|
|
|
pub fn default_endpoint() -> Option<Endpoint> {
|
2015-09-24 03:02:28 +00:00
|
|
|
Some(Endpoint)
|
|
|
|
}
|
|
|
|
|
2017-10-20 19:18:40 +00:00
|
|
|
pub type SupportedFormatsIterator = VecIntoIter<SupportedFormat>;
|