Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Methods usable without RpcModule #1028

Merged
merged 1 commit into from
Feb 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions core/src/server/rpc_module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,8 @@ impl Methods {
Self::default()
}

fn verify_method_name(&mut self, name: &'static str) -> Result<(), Error> {
/// Verifies that the method name is not already taken, and returns an error if it is.
pub fn verify_method_name(&mut self, name: &'static str) -> Result<(), Error> {
if self.callbacks.contains_key(name) {
return Err(Error::MethodAlreadyRegistered(name.into()));
}
Expand All @@ -340,7 +341,7 @@ impl Methods {

/// Inserts the method callback for a given name, or returns an error if the name was already taken.
/// On success it returns a mut reference to the [`MethodCallback`] just inserted.
fn verify_and_insert(
pub fn verify_and_insert(
&mut self,
name: &'static str,
callback: MethodCallback,
Expand Down