pub trait ServerFacts:
AsyncRuntime
+ Sync
+ Send
+ 'static
+ Sized {
// Required methods
fn get_config(&self) -> &ServerConfig;
fn new_logger(&self) -> Arc<LogFilter>;
}Expand description
A central hub defined by the user for the server-side, to define the customizable plugin.
§NOTE
If you choose implement this trait rather than use ServerDefault
We recommend your implementation to Deref<Target=orb::AsyncRuntime>
then the blanket trait in orb crate will automatically impl AsyncRuntime on your ClientFacts type.
Refer to the code of ServerDefault for example.
Required Methods§
Sourcefn get_config(&self) -> &ServerConfig
fn get_config(&self) -> &ServerConfig
You should keep ServerConfig inside, get_config() will return the reference.
Sourcefn new_logger(&self) -> Arc<LogFilter>
fn new_logger(&self) -> Arc<LogFilter>
Construct a captains_log::filter::Filter to oganize log of a client
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.