pub struct TasksState { /* private fields */ }Expand description
Materialized view over the tasks log.
Serialize / Deserialize are derived so the state can be
snapshotted via super::super::CortexAdapter::snapshot and
restored via super::super::CortexAdapter::open_from_snapshot.
Implementations§
Source§impl TasksState
impl TasksState
Sourcepub fn query(&self) -> TasksQuery<'_>
pub fn query(&self) -> TasksQuery<'_>
Start a fluent query over this state snapshot.
Source§impl TasksState
impl TasksState
Sourcepub fn find_unique(&self, id: TaskId) -> Option<&Task>
pub fn find_unique(&self, id: TaskId) -> Option<&Task>
Look up a task by id. Alias of Self::get, named to match
the Prisma-style NetDB surface.
Sourcepub fn find_many(&self, filter: &TasksFilter) -> Vec<Task>
pub fn find_many(&self, filter: &TasksFilter) -> Vec<Task>
Collect all tasks matching filter (cloned), respecting
order + limit.
Sourcepub fn count_where(&self, filter: &TasksFilter) -> usize
pub fn count_where(&self, filter: &TasksFilter) -> usize
Count tasks matching filter. Ignores limit.
Sourcepub fn exists_where(&self, filter: &TasksFilter) -> bool
pub fn exists_where(&self, filter: &TasksFilter) -> bool
True if any task matches filter. Short-circuits on first hit.
Trait Implementations§
Source§impl Clone for TasksState
impl Clone for TasksState
Source§fn clone(&self) -> TasksState
fn clone(&self) -> TasksState
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 moreSource§impl Debug for TasksState
impl Debug for TasksState
Source§impl Default for TasksState
impl Default for TasksState
Source§fn default() -> TasksState
fn default() -> TasksState
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for TasksState
impl<'de> Deserialize<'de> for TasksState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl RedexFold<TasksState> for TasksFold
impl RedexFold<TasksState> for TasksFold
Source§fn apply(
&mut self,
ev: &RedexEvent,
state: &mut TasksState,
) -> Result<(), RedexError>
fn apply( &mut self, ev: &RedexEvent, state: &mut TasksState, ) -> Result<(), RedexError>
Apply one event to
state. Return an error to stop the fold.Auto Trait Implementations§
impl Freeze for TasksState
impl RefUnwindSafe for TasksState
impl Send for TasksState
impl Sync for TasksState
impl Unpin for TasksState
impl UnsafeUnpin for TasksState
impl UnwindSafe for TasksState
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