pub struct RequestRouter { /* private fields */ }Expand description
请求路由器
Implementations§
Source§impl RequestRouter
impl RequestRouter
Sourcepub fn new() -> Self
pub fn new() -> Self
创建空路由器。使用 Self::register 挂 handler。
pub fn with_startup_readiness(startup_readiness: StartupReadiness) -> Self
pub fn startup_readiness(&self) -> StartupReadiness
pub fn set_startup_readiness(&self, startup_readiness: StartupReadiness)
Sourcepub fn register(&self, proto_id: u32, handler: Arc<dyn RequestHandler>)
pub fn register(&self, proto_id: u32, handler: Arc<dyn RequestHandler>)
注册业务处理器
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for RequestRouter
impl !RefUnwindSafe for RequestRouter
impl !UnwindSafe for RequestRouter
impl Send for RequestRouter
impl Sync for RequestRouter
impl Unpin for RequestRouter
impl UnsafeUnpin for RequestRouter
Blanket Implementations§
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.