mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 04:33:37 +00:00
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:
parent
7c6057bc69
commit
453c0167b2
1 changed files with 5 additions and 0 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue