pub struct LazyExpression { /* private fields */ }Expand description
惰性表达式
Implementations§
Source§impl LazyExpression
impl LazyExpression
Sourcepub fn new(id: usize, expr: Expression) -> Self
pub fn new(id: usize, expr: Expression) -> Self
创建新的惰性表达式
Sourcepub fn with_compute_fn<F>(id: usize, expr: Expression, compute_fn: F) -> Selfwhere
F: Fn(&Expression, &dyn ComputeEngine) -> Result<Expression, ComputeError> + Send + Sync + 'static,
pub fn with_compute_fn<F>(id: usize, expr: Expression, compute_fn: F) -> Selfwhere
F: Fn(&Expression, &dyn ComputeEngine) -> Result<Expression, ComputeError> + Send + Sync + 'static,
创建带计算函数的惰性表达式
Sourcepub fn add_dependency(&mut self, dep: Arc<LazyExpression>)
pub fn add_dependency(&mut self, dep: Arc<LazyExpression>)
添加依赖
Sourcepub fn set_priority(&mut self, priority: i32)
pub fn set_priority(&mut self, priority: i32)
设置优先级
Sourcepub fn original(&self) -> &Expression
pub fn original(&self) -> &Expression
获取原始表达式
Sourcepub fn dependencies(&self) -> &[Arc<LazyExpression>]
pub fn dependencies(&self) -> &[Arc<LazyExpression>]
获取依赖列表
Sourcepub fn is_computed(&self) -> bool
pub fn is_computed(&self) -> bool
检查是否已计算完成
Sourcepub fn is_computing(&self) -> bool
pub fn is_computing(&self) -> bool
检查是否正在计算
Sourcepub fn can_compute(&self) -> bool
pub fn can_compute(&self) -> bool
检查是否可以开始计算(所有依赖都已完成)
Sourcepub fn get_result(&self) -> Option<Expression>
pub fn get_result(&self) -> Option<Expression>
获取计算结果(如果已计算完成)
Sourcepub fn get_error(&self) -> Option<ComputeError>
pub fn get_error(&self) -> Option<ComputeError>
获取计算错误(如果计算失败)
Sourcepub fn force_compute(
&self,
engine: &dyn ComputeEngine,
) -> Result<Expression, ComputeError>
pub fn force_compute( &self, engine: &dyn ComputeEngine, ) -> Result<Expression, ComputeError>
强制计算表达式
Trait Implementations§
Source§impl Clone for LazyExpression
impl Clone for LazyExpression
Source§fn clone(&self) -> LazyExpression
fn clone(&self) -> LazyExpression
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for LazyExpression
impl !RefUnwindSafe for LazyExpression
impl Send for LazyExpression
impl Sync for LazyExpression
impl Unpin for LazyExpression
impl !UnwindSafe for LazyExpression
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<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