pub struct Pred { /* private fields */ }Expand description
Predicate of a selective receive: test decides which payloads it accepts, and repr
is a human-readable tag used for Debug/Display and the graph’s canonical key.
repr tags a receive by its program-order position, so the same event gets the same
repr across replays. It is not a global identity: two predicates at the same position
on different branches or threads can share a repr, so never rely on Pred equality
across threads or branches.
Implementations§
Source§impl Pred
impl Pred
pub fn new( repr: impl Into<String>, test: impl Fn(&str) -> bool + Send + Sync + 'static, ) -> Self
Sourcepub fn eq(v: impl Into<String>) -> Self
pub fn eq(v: impl Into<String>) -> Self
Predicate x == v. Records the interned target so test_sym can
match by handle without resolving.
Sourcepub fn test_sym(&self, v: Val) -> bool
pub fn test_sym(&self, v: Val) -> bool
Whether the interned payload v satisfies the predicate. Equality predicates match
by handle (no resolve); a general predicate resolves v and runs its closure.
pub fn repr(&self) -> &str
Trait Implementations§
impl Eq for Pred
Auto Trait Implementations§
impl !RefUnwindSafe for Pred
impl !UnwindSafe for Pred
impl Freeze for Pred
impl Send for Pred
impl Sync for Pred
impl Unpin for Pred
impl UnsafeUnpin for Pred
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