pub struct FieldSpec {
pub name: FieldName,
pub kind: FieldKind,
pub storage: StorageSpec,
pub validation: ValidationSpec,
pub access: AccessSpec,
pub presentation: PresentationSpec,
pub relation: Option<FieldRef>,
pub select: Option<ActionRef>,
pub options: Vec<(String, String)>,
pub timestamp_mode: TimestampMode,
pub tenant_key: bool,
}Expand description
单个字段的共享语义核心。
Fields§
§name: FieldName字段名。
kind: FieldKind字段语义种类。
storage: StorageSpec数据库存储语义。
validation: ValidationSpec输入验证语义。
access: AccessSpec访问控制语义。
presentation: PresentationSpec默认展示语义。
relation: Option<FieldRef>可选关系目标。
select: Option<ActionRef>可选选择器 Action。
options: Vec<(String, String)>Radio 的值与标题。
timestamp_mode: TimestampMode时间戳自动写入模式。
tenant_key: bool是否为租户隔离键。
Implementations§
Source§impl FieldSpec
impl FieldSpec
Sourcepub fn is_required(&self) -> bool
pub fn is_required(&self) -> bool
返回字段是否必填。
Sourcepub fn tenant_key(self, tenant_key: bool) -> Self
pub fn tenant_key(self, tenant_key: bool) -> Self
将字段标记为租户隔离键。
Sourcepub fn widget_hint(&self) -> WidgetHint
pub fn widget_hint(&self) -> WidgetHint
返回字段的前端控件提示。
显式 PresentationSpec::widget 优先;未设置时按字段数据语义确定性映射。
secret 字符串默认使用密码控件,但该展示提示不改变服务端读写权限。
Trait Implementations§
impl Eq for FieldSpec
impl StructuralPartialEq for FieldSpec
Auto Trait Implementations§
impl Forget for FieldSpec
impl Freeze for FieldSpec
impl Move for FieldSpec
impl RefUnwindSafe for FieldSpec
impl Send for FieldSpec
impl Sync for FieldSpec
impl Unpin for FieldSpec
impl UnsafeUnpin for FieldSpec
impl UnwindSafe for FieldSpec
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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