use std::collections::BTreeSet;
use crate::{
component::ComponentId,
group::proposal_store::{ProposalQueue, QueuedAppEphemeralProposal},
};
impl ProposalQueue {
pub fn app_ephemeral_proposals_for_component_id(
&self,
component_id: ComponentId,
) -> impl Iterator<Item = QueuedAppEphemeralProposal<'_>> {
self.app_ephemeral_proposals()
.filter(move |p| p.app_ephemeral_proposal().component_id() == component_id)
}
pub fn unique_component_ids_for_app_ephemeral(&self) -> Vec<ComponentId> {
let ids: BTreeSet<_> = self
.app_ephemeral_proposals()
.map(|p| p.app_ephemeral_proposal().component_id())
.collect();
ids.into_iter().collect()
}
}