Trait server_fn::ServerFunctionRegistry
source · pub trait ServerFunctionRegistry<T> {
type Error: Error;
// Required methods
fn register_explicit(
prefix: &'static str,
url: &'static str,
server_function: SerializedFnTraitObj<T>,
encoding: Encoding
) -> Result<(), Self::Error>;
fn get(url: &str) -> Option<ServerFnTraitObj<T>>;
fn get_trait_obj(url: &str) -> Option<ServerFnTraitObj<T>>;
fn get_encoding(url: &str) -> Option<Encoding>;
fn paths_registered() -> Vec<&'static str>;
}Expand description
Something that can register a server function.
Required Associated Types§
Required Methods§
sourcefn register_explicit(
prefix: &'static str,
url: &'static str,
server_function: SerializedFnTraitObj<T>,
encoding: Encoding
) -> Result<(), Self::Error>
fn register_explicit( prefix: &'static str, url: &'static str, server_function: SerializedFnTraitObj<T>, encoding: Encoding ) -> Result<(), Self::Error>
Server functions are automatically registered on most platforms, (including Linux, macOS, iOS, FreeBSD, Android, and Windows). If you are on another platform, like a WASM server runtime, this will explicitly register server functions.
sourcefn get(url: &str) -> Option<ServerFnTraitObj<T>>
fn get(url: &str) -> Option<ServerFnTraitObj<T>>
Returns the server function registered at the given URL, or None if no function is registered at that URL.
sourcefn get_trait_obj(url: &str) -> Option<ServerFnTraitObj<T>>
fn get_trait_obj(url: &str) -> Option<ServerFnTraitObj<T>>
Returns the server function registered at the given URL, or None if no function is registered at that URL.
sourcefn get_encoding(url: &str) -> Option<Encoding>
fn get_encoding(url: &str) -> Option<Encoding>
Returns the encoding of the server FN 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.
Object Safety§
This trait is not object safe.