Trait server_fn::ServerFunctionRegistry
source · pub trait ServerFunctionRegistry<T> {
type Error: Error;
// Required methods
fn register(
url: &'static str,
server_function: Arc<ServerFnTraitObj<T>>
) -> Result<(), Self::Error>;
fn get(url: &str) -> Option<Arc<ServerFnTraitObj<T>>>;
fn paths_registered() -> Vec<&'static str>;
}
Expand description
Something that can register a server function.
Required Associated Types§
Required Methods§
sourcefn register(
url: &'static str,
server_function: Arc<ServerFnTraitObj<T>>
) -> Result<(), Self::Error>
fn register( url: &'static str, server_function: Arc<ServerFnTraitObj<T>> ) -> Result<(), Self::Error>
Registers a server function at the given URL.
sourcefn get(url: &str) -> Option<Arc<ServerFnTraitObj<T>>>
fn get(url: &str) -> Option<Arc<ServerFnTraitObj<T>>>
Returns the server function registered at the given URL, or None
if no function is registered at that URL.
sourcefn paths_registered() -> Vec<&'static str>
fn paths_registered() -> Vec<&'static str>
Returns a list of all registered server functions.