pub struct Mapped {
pub type_param: String,
pub constraint: Box<TsValue>,
pub value_type: Box<TsValue>,
pub key_modifier: MappedKeyModifier,
pub constraint_type: MappedConstraint,
}Expand description
映射类型,表示 { [K in keyof T]: V } 或类似形式
Fields§
§type_param: String类型参数名称 (K)
constraint: Box<TsValue>键的来源类型 (keyof T)
value_type: Box<TsValue>值类型表达式,可以引用类型参数
key_modifier: MappedKeyModifier键修饰符
constraint_type: MappedConstraint约束类型
Implementations§
Source§impl Mapped
impl Mapped
Sourcepub fn with_optional(self) -> Self
pub fn with_optional(self) -> Self
设置为可选属性
Sourcepub fn with_readonly(self) -> Self
pub fn with_readonly(self) -> Self
设置为只读属性
Sourcepub fn with_constraint(self, constraint: MappedConstraint) -> Self
pub fn with_constraint(self, constraint: MappedConstraint) -> Self
设置约束类型
Trait Implementations§
impl Eq for Mapped
impl StructuralPartialEq for Mapped
Auto Trait Implementations§
impl Freeze for Mapped
impl !RefUnwindSafe for Mapped
impl Send for Mapped
impl Sync for Mapped
impl Unpin for Mapped
impl UnsafeUnpin for Mapped
impl !UnwindSafe for Mapped
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