pub struct SafeExpression<R, T> { /* private fields */ }Implementations§
Source§impl<R, T> SafeExpression<R, T>
impl<R, T> SafeExpression<R, T>
pub fn new( root: R, evaluator: impl Fn(&R) -> Option<T> + Send + Sync + 'static, ) -> Self
pub fn eval(&self) -> Option<T>
pub fn eval_with(&self, root: &R) -> Option<T>
pub fn apply<U>(
self,
mapper: impl Fn(T) -> U + Send + Sync + 'static,
) -> SafeExpression<R, U>where
U: 'static,
pub fn apply_optional<U>(
self,
mapper: impl Fn(T) -> Option<U> + Send + Sync + 'static,
) -> SafeExpression<R, U>where
U: 'static,
pub fn or_else(&self, default_value: T) -> T
pub fn or_else_with(&self, default_value: impl FnOnce() -> T) -> T
pub fn or_else_throw<E>(&self, error: impl FnOnce() -> E) -> Result<T, E>
pub fn is_null(&self) -> bool
pub fn is_not_null(&self) -> bool
pub fn is_empty(&self) -> boolwhere
T: TeaqlEmpty,
pub fn is_not_empty(&self) -> boolwhere
T: TeaqlEmpty,
pub fn when_is_null(&self, function: impl FnOnce())
pub fn when_is_not_null(&self, consumer: impl FnOnce(T))
pub fn when_is_empty(&self, function: impl FnOnce())where
T: TeaqlEmpty,
pub fn when_not_empty(&self, consumer: impl FnOnce(T))where
T: TeaqlEmpty,
Source§impl<R> SafeExpression<R, R>
impl<R> SafeExpression<R, R>
Source§impl<R, E> SafeExpression<R, E>
impl<R, E> SafeExpression<R, E>
pub fn entity_id(self) -> SafeExpression<R, u64>
pub fn entity_version(self) -> SafeExpression<R, i64>
pub fn update_entity_id(self, id: u64) -> SafeExpression<R, E>
Source§impl<R, T> SafeExpression<R, SmartList<T>>
impl<R, T> SafeExpression<R, SmartList<T>>
pub fn size(self) -> SafeExpression<R, usize>
pub fn first(self) -> SafeExpression<R, T>
pub fn get(self, index: usize) -> SafeExpression<R, T>
Trait Implementations§
Auto Trait Implementations§
impl<R, T> Freeze for SafeExpression<R, T>
impl<R, T> !RefUnwindSafe for SafeExpression<R, T>
impl<R, T> Send for SafeExpression<R, T>
impl<R, T> Sync for SafeExpression<R, T>
impl<R, T> Unpin for SafeExpression<R, T>
impl<R, T> UnsafeUnpin for SafeExpression<R, T>
impl<R, T> !UnwindSafe for SafeExpression<R, T>
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