pub struct ServeArgs {
pub with_admin: bool,
pub with_tenant: bool,
pub with_data_scope: bool,
pub addr: String,
pub watch_config: bool,
pub workers: Option<u16>,
pub grace_timeout: Option<u16>,
pub tls_cert: Option<PathBuf>,
pub tls_key: Option<PathBuf>,
pub access_log: bool,
pub health: bool,
}Expand description
serve 命令参数集合
由 clap Command::Serve 变体字段映射构造,用于解耦 CLI 解析与业务逻辑。
Fields§
§with_admin: bool启用 admin 插件(加载 /api/admin/* 路由 + Capability 注册)
with_tenant: bool启用 tenant_middleware(从 X-Tenant-Id Header 提取租户 ID 并设置 TenantContext)
with_data_scope: bool启用 data_scope_middleware(从请求 extensions 提取 DataScopeUserContext 并注入 DataScopeContext)
addr: String监听地址(默认 0.0.0.0:8080)
watch_config: bool启用配置热重载(监听 config/ 目录文件变更)
workers: Option<u16>worker 线程数(None 时用配置文件值或 CPU 核心数)
grace_timeout: Option<u16>优雅关闭超时秒数(None 时用配置文件值或默认 30)
tls_cert: Option<PathBuf>TLS 证书文件路径
tls_key: Option<PathBuf>TLS 私钥文件路径
access_log: bool启用访问日志中间件
health: bool启用健康检查端点(默认 true)
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ServeArgs
impl RefUnwindSafe for ServeArgs
impl Send for ServeArgs
impl Sync for ServeArgs
impl Unpin for ServeArgs
impl UnsafeUnpin for ServeArgs
impl UnwindSafe for ServeArgs
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.