bevyengine / bevyengine/bevy

Add `Events::retain`

Open
#12,204 2 comments 0 reactions 0 assignees View on GitHub
A-ECS C-Usability D-Trivial
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

## What problem does this solve or what need does it fill?

Sometimes it's useful to not drain all events from `Events`, but by a specific predicate.

## What solution would you like?

There is [Vec::retain](https://doc.rust-lang.org/std/vec/struct.Vec.html#method.retain) and it would be convenient to have something like this in `Events` too.

## What alternative(s) have you considered?

Other solutions to solve and/or work around the problem presented.

## Additional context

Many networking crates translate messages into events (like mine) and it would be convenient to be able to drop events from a particular client if it was disconnected from the server.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.