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§

source

type Error: Error

An error that can occur when registering a server function.

Required Methods§

source

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.

source

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.

source

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.

source

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

source

fn paths_registered() -> Vec<&'static str>

Returns a list of all registered server functions.

Object Safety§

This trait is not object safe.

Implementors§