feat: expose `Candidate::discarded`
This is useful / necessary to differentiate between active and invalidated candidates when accessing them via IceAgent::local_candidates.
Alternatively, we could also filter them directly there or prune all discarded candidates from the agent?
Could we filter them instead?
As I see it,
Candidateshould not have a state. The discarded flag is probably there or convenience, but we don't want it. Especially not in public API.
Yeah definitely. So local_candidates and remote_candidates always filtered by !discarded?
Shall we move them to a different collection perhaps so we can remove the state?
I think because we use usize indexes to the vec holding them, we can't move them out easily. We could make some wrapper Entry type to hold the state and candidate though.
I think because we use usize indexes to the vec holding them, we can't move them out easily. We could make some wrapper Entry type to hold the state and candidate though.
Hmm, right. Perhaps a slab would help here?