pub struct ServerDefault<RT: AsyncRuntime> {
pub logger: Arc<LogFilter>,
/* private fields */
}Expand description
An ServerFacts for general use
Fields§
§logger: Arc<LogFilter>Implementations§
Source§impl<RT: AsyncRuntime> ServerDefault<RT>
impl<RT: AsyncRuntime> ServerDefault<RT>
pub fn new(config: ServerConfig, rt: RT) -> Arc<Self>
pub fn set_log_level(&self, level: Level)
Trait Implementations§
Source§impl<RT: AsyncRuntime> Deref for ServerDefault<RT>
impl<RT: AsyncRuntime> Deref for ServerDefault<RT>
Source§impl<RT: AsyncRuntime> ServerFacts for ServerDefault<RT>
impl<RT: AsyncRuntime> ServerFacts for ServerDefault<RT>
Source§fn new_logger(&self) -> Arc<LogFilter>
fn new_logger(&self) -> Arc<LogFilter>
Construct a captains_log::filter::Filter to oganize log of a client
Source§fn get_config(&self) -> &ServerConfig
fn get_config(&self) -> &ServerConfig
You should keep ServerConfig inside, get_config() will return the reference.
Auto Trait Implementations§
impl<RT> Freeze for ServerDefault<RT>where
RT: Freeze,
impl<RT> RefUnwindSafe for ServerDefault<RT>where
RT: RefUnwindSafe,
impl<RT> Send for ServerDefault<RT>
impl<RT> Sync for ServerDefault<RT>
impl<RT> Unpin for ServerDefault<RT>where
RT: Unpin,
impl<RT> UnwindSafe for ServerDefault<RT>where
RT: UnwindSafe,
Blanket Implementations§
Source§impl<FT, T> AsyncExec for FT
impl<FT, T> AsyncExec for FT
type AsyncHandle<R: Send> = <T as AsyncExec>::AsyncHandle<R>
type ThreadHandle<R: Send> = <T as AsyncExec>::ThreadHandle<R>
Source§fn spawn<F, R>(&self, f: F) -> <FT as AsyncExec>::AsyncHandle<R>
fn spawn<F, R>(&self, f: F) -> <FT as AsyncExec>::AsyncHandle<R>
Spawn a task in the background, returning a handle to await its result. Read more
Source§fn spawn_detach<F, R>(&self, f: F)
fn spawn_detach<F, R>(&self, f: F)
Spawn a task and detach it (no handle returned). Read more
Source§fn spawn_blocking<F, R>(f: F) -> <FT as AsyncExec>::ThreadHandle<R>
fn spawn_blocking<F, R>(f: F) -> <FT as AsyncExec>::ThreadHandle<R>
Run blocking code in a background thread pool, and return an async join handle Read more
Source§impl<F, IO> AsyncIO for F
impl<F, IO> AsyncIO for F
Source§type AsyncFd<T: AsRawFd + AsFd + Send + Sync + 'static> = <IO as AsyncIO>::AsyncFd<T>
type AsyncFd<T: AsRawFd + AsFd + Send + Sync + 'static> = <IO as AsyncIO>::AsyncFd<T>
The type used to represent async file descriptors. Read more
Source§fn connect_tcp(
addr: &SocketAddr,
) -> impl Future<Output = Result<<F as AsyncIO>::AsyncFd<TcpStream>, Error>> + Send
fn connect_tcp( addr: &SocketAddr, ) -> impl Future<Output = Result<<F as AsyncIO>::AsyncFd<TcpStream>, Error>> + Send
Connect to a TCP address asynchronously. Read more
Source§fn connect_unix(
addr: &Path,
) -> impl Future<Output = Result<<F as AsyncIO>::AsyncFd<UnixStream>, Error>> + Send
fn connect_unix( addr: &Path, ) -> impl Future<Output = Result<<F as AsyncIO>::AsyncFd<UnixStream>, Error>> + Send
Connect to a Unix socket address asynchronously. Read more
Source§impl<F, T> AsyncTime for F
impl<F, T> AsyncTime for F
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T, A> DynAccess<T> for A
impl<T, A> DynAccess<T> for A
Source§fn load(&self) -> DynGuard<T>
fn load(&self) -> DynGuard<T>
The equivalent of
Access::load.