pub struct FeatureSet(/* private fields */);Expand description
位掩码形式的特性集合。
设计哲学:从极简到丰富、功能可裁剪。默认基线(baseline())只开极简三件套
(include + namespace + implicit-ns),复杂能力(多目标 / glob / 正则 /
扩展名重写)必须显式 @feature enable 才生效,避免重蹈 YAML 过度复杂的覆辙。
Implementations§
Source§impl FeatureSet
impl FeatureSet
Sourcepub fn all() -> FeatureSet
pub fn all() -> FeatureSet
全部特性位(含所有 opt-in 能力)。用于「调用方允许全集」与版本基线,
实际默认并不开启这些——见 FeatureSet::baseline。
Sourcepub fn baseline() -> FeatureSet
pub fn baseline() -> FeatureSet
极简默认集(SML 核心可用能力)。这是 parse_file 的默认允许集;
仅「多目标 / glob / 正则 / 扩展名重写」等高级能力需文档内
@feature enable 显式开启(避免重蹈 YAML 覆辙)。
Sourcepub fn none() -> FeatureSet
pub fn none() -> FeatureSet
空集合
Sourcepub fn for_version(v: Version) -> FeatureSet
pub fn for_version(v: Version) -> FeatureSet
按版本基线构造默认特性集:v1 极简默认(baseline)+ 裸词字符串;
v2/v3 关闭裸词字符串(须引号)。复杂能力(glob/regex/multi…)仍默认关闭,
需文档 @feature enable 显式开启。
Sourcepub fn with(self, f: Feature) -> FeatureSet
pub fn with(self, f: Feature) -> FeatureSet
返回开启 f 后的副本
Sourcepub fn without(self, f: Feature) -> FeatureSet
pub fn without(self, f: Feature) -> FeatureSet
返回关闭 f 后的副本
Sourcepub fn intersection(self, other: FeatureSet) -> FeatureSet
pub fn intersection(self, other: FeatureSet) -> FeatureSet
与另一集合取交集(用于「文档裁剪 ∩ 调用方允许」)
Trait Implementations§
Source§impl Clone for FeatureSet
impl Clone for FeatureSet
Source§fn clone(&self) -> FeatureSet
fn clone(&self) -> FeatureSet
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for FeatureSet
Source§impl Debug for FeatureSet
impl Debug for FeatureSet
Source§impl Display for FeatureSet
impl Display for FeatureSet
impl Eq for FeatureSet
Source§impl PartialEq for FeatureSet
impl PartialEq for FeatureSet
impl StructuralPartialEq for FeatureSet
Auto Trait Implementations§
impl Freeze for FeatureSet
impl RefUnwindSafe for FeatureSet
impl Send for FeatureSet
impl Sync for FeatureSet
impl Unpin for FeatureSet
impl UnsafeUnpin for FeatureSet
impl UnwindSafe for FeatureSet
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