pub struct Tools { /* private fields */ }Expand description
构建完成后冻结的应用资源。
Implementations§
Source§impl Tools
impl Tools
Sourcepub fn state(&self) -> ToolsState
pub fn state(&self) -> ToolsState
返回当前生命周期状态。
Sourcepub fn cache(&self) -> Result<&RedisClient, BaseError>
pub fn cache(&self) -> Result<&RedisClient, BaseError>
获取 Redis 客户端;未配置或生命周期已结束时失败。
Sourcepub fn token(&self) -> Result<&TokenManager, BaseError>
pub fn token(&self) -> Result<&TokenManager, BaseError>
获取 Token 管理器;未配置或生命周期已结束时失败。
Sourcepub fn http(&self) -> Result<&HttpClient, BaseError>
pub fn http(&self) -> Result<&HttpClient, BaseError>
获取 HTTP 客户端;未配置或生命周期已结束时失败。
reqwest 客户端无需显式关闭,故该槽位不参与 close/health_check 流程。
Sourcepub async fn health_check(&self) -> ToolsHealth
pub async fn health_check(&self) -> ToolsHealth
检查所有已配置核心资源并返回稳定快照。
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Tools
impl !RefUnwindSafe for Tools
impl !UnwindSafe for Tools
impl Send for Tools
impl Sync for Tools
impl Unpin for Tools
impl UnsafeUnpin for Tools
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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