#[non_exhaustive]pub struct ActionMeta {
pub name: &'static str,
pub display_name: &'static str,
pub description: &'static str,
pub permissions: &'static [Permission],
pub permission_mode: PermissionMode,
pub is_public: bool,
pub input_schema: &'static RootSchema,
pub output_schema: &'static RootSchema,
}Expand description
单个 Action 的静态元信息聚合体。
标注 #[non_exhaustive]:未来新增字段不构成破坏性变更。
请使用 ActionMeta::new 构造。
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: &'static strAction 唯一标识,路由 dispatch 时用
display_name: &'static str用户可见的显示名
description: &'static str简介
permissions: &'static [Permission]所需权限列表(dispatch 时检查)
permission_mode: PermissionMode权限匹配模式:All(AND)或 Any(OR)
is_public: bool是否公开(true 则跳过权限/登录检查)
input_schema: &'static RootSchema入参 JSON Schema(OnceLock 生成)
output_schema: &'static RootSchema出参 JSON Schema
Implementations§
Source§impl ActionMeta
impl ActionMeta
Sourcepub const fn new(
name: &'static str,
display_name: &'static str,
description: &'static str,
permissions: &'static [Permission],
permission_mode: PermissionMode,
is_public: bool,
input_schema: &'static RootSchema,
output_schema: &'static RootSchema,
) -> Self
pub const fn new( name: &'static str, display_name: &'static str, description: &'static str, permissions: &'static [Permission], permission_mode: PermissionMode, is_public: bool, input_schema: &'static RootSchema, output_schema: &'static RootSchema, ) -> Self
构造 ActionMeta(#[non_exhaustive] 后的唯一公开构造入口)。
Auto Trait Implementations§
impl Forget for ActionMeta
impl Freeze for ActionMeta
impl Move for ActionMeta
impl RefUnwindSafe for ActionMeta
impl Send for ActionMeta
impl Sync for ActionMeta
impl Unpin for ActionMeta
impl UnsafeUnpin for ActionMeta
impl UnwindSafe for ActionMeta
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