str0m icon indicating copy to clipboard operation
str0m copied to clipboard

feat: expose `Candidate::discarded`

Open thomaseizinger opened this issue 1 year ago • 3 comments

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?

thomaseizinger avatar Apr 17 '24 02:04 thomaseizinger

Could we filter them instead?

As I see it, Candidate should 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?

thomaseizinger avatar Apr 18 '24 22:04 thomaseizinger

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.

algesten avatar Apr 19 '24 03:04 algesten

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?

thomaseizinger avatar Apr 19 '24 03:04 thomaseizinger