pub trait WorldFilter: Any {
// Required methods
fn filter(components_ids: &'static [TypeId]) -> bool;
fn filter_by_meta(meta: &mut BundleMeta) -> bool;
}Expand description
用来过滤Bundle
作为WorldFetch的附属使用
Required Methods§
Sourcefn filter(components_ids: &'static [TypeId]) -> bool
fn filter(components_ids: &'static [TypeId]) -> bool
传入Bundle的components_ids
- 返回true表示通过
- 返回false表示没
Sourcefn filter_by_meta(meta: &mut BundleMeta) -> bool
fn filter_by_meta(meta: &mut BundleMeta) -> bool
加速版本,会从缓存读取,否则重新计算
主要是为了让嵌套的WorldFilter可以更快
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.