pub struct ToolsBuilder { /* private fields */ }Expand description
仅在启动期可变的应用资源构建器。
Implementations§
Source§impl ToolsBuilder
impl ToolsBuilder
Sourcepub fn cache(self, cache: RedisClient) -> Self
pub fn cache(self, cache: RedisClient) -> Self
设置唯一 Redis 客户端。
Sourcepub fn token(self, token: TokenManager) -> Self
pub fn token(self, token: TokenManager) -> Self
设置唯一 Token 管理器。
Sourcepub fn http(self, client: HttpClient) -> Self
pub fn http(self, client: HttpClient) -> Self
设置唯一 HTTP 客户端。
reqwest 客户端无需显式关闭,构建后只读共享,不参与 close/health_check 流程。
Trait Implementations§
Source§impl Debug for ToolsBuilder
impl Debug for ToolsBuilder
Source§impl Default for ToolsBuilder
impl Default for ToolsBuilder
Source§fn default() -> ToolsBuilder
fn default() -> ToolsBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for ToolsBuilder
impl !UnwindSafe for ToolsBuilder
impl Freeze for ToolsBuilder
impl Send for ToolsBuilder
impl Sync for ToolsBuilder
impl Unpin for ToolsBuilder
impl UnsafeUnpin for ToolsBuilder
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