cpal/src/coreaudio/enumerate.rs

37 lines
672 B
Rust
Raw Normal View History

use super::Endpoint;
2017-10-11 11:24:49 +00:00
use Format;
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 {
}
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)
}
}
}
pub fn get_default_endpoint() -> Option<Endpoint> {
Some(Endpoint)
}
pub type SupportedFormatsIterator = VecIntoIter<Format>;