Allow access a method handler (#15601)

# Objective

- I'm building a streaming plugin for `bevy_remote` and accessing to
builtin method will be very valuable

## Solution

- Add a method to allow access a handler by method name.

## Testing

- CI should pass
This commit is contained in:
notmd 2024-10-03 02:45:18 +07:00 committed by GitHub
parent 7c6057bc69
commit 453c0167b2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -399,6 +399,11 @@ impl RemoteMethods {
) -> Option<RemoteMethod> {
self.0.insert(method_name.into(), handler)
}
/// Retrieves a handler by method name.
pub fn get(&self, method_name: &str) -> Option<&RemoteMethod> {
self.0.get(method_name)
}
}
/// A single request from a Bevy Remote Protocol client to the server,