pub struct OnionLazySet { /* private fields */ }
Expand description
Onion 惰性集合。
封装一个容器对象和一个过滤器对象,支持基于过滤器的惰性筛选。 适用于大规模数据的延迟求值与高效遍历。
§字段
container
: 集合的底层容器对象(如元组、数组等)filter
: 用于筛选元素的过滤器对象(如 Lambda 表达式)
Implementations§
Source§impl OnionLazySet
impl OnionLazySet
Sourcepub fn new(container: OnionObject, filter: OnionObject) -> Self
pub fn new(container: OnionObject, filter: OnionObject) -> Self
Sourcepub fn new_static(
container: &OnionStaticObject,
filter: &OnionStaticObject,
) -> OnionStaticObject
pub fn new_static( container: &OnionStaticObject, filter: &OnionStaticObject, ) -> OnionStaticObject
Sourcepub fn get_container(&self) -> &OnionObject
pub fn get_container(&self) -> &OnionObject
获取底层容器对象的引用。
Sourcepub fn get_filter(&self) -> &OnionObject
pub fn get_filter(&self) -> &OnionObject
获取过滤器对象的引用。
Sourcepub fn upgrade(&self, collected: &mut Vec<GCArc<OnionObjectCell>>)
pub fn upgrade(&self, collected: &mut Vec<GCArc<OnionObjectCell>>)
升级集合中的所有对象引用。
用于 GC 跟踪,防止集合中的对象被提前回收。
Sourcepub fn with_attribute<F, R>(
&self,
key: &OnionObject,
f: &F,
) -> Result<R, RuntimeError>
pub fn with_attribute<F, R>( &self, key: &OnionObject, f: &F, ) -> Result<R, RuntimeError>
Trait Implementations§
Source§impl Debug for OnionLazySet
impl Debug for OnionLazySet
Source§impl GCTraceable<OnionObjectCell> for OnionLazySet
impl GCTraceable<OnionObjectCell> for OnionLazySet
Auto Trait Implementations§
impl Freeze for OnionLazySet
impl !RefUnwindSafe for OnionLazySet
impl Send for OnionLazySet
impl Sync for OnionLazySet
impl Unpin for OnionLazySet
impl !UnwindSafe for OnionLazySet
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