Skip to main content

Label

Enum Label 

Source
pub enum Label {
    Send {
        model: Model,
        dst: Tid,
        val: Val,
    },
    Recv {
        pred: Arc<Pred>,
        blocking: bool,
    },
    Nondet {
        set: Arc<[Val]>,
    },
    Error {
        msg: Arc<str>,
    },
}
Expand description

Event label. Blocking is scheduler state, not a graph event, so it has no label here. Nondet carries only the option set; the value it resolved to is a separate graph annotation, just as a receive’s read value is its rf edge rather than part of its label.

The heap-carrying variants hold their payload behind an Arc, so cloning a Label shares it; labels are immutable, so the sharing is sound.

Variants§

§

Send

Fields

§model: Model
§dst: Tid
§val: Val
§

Recv

Fields

§pred: Arc<Pred>
§blocking: bool
§

Nondet

Data non-determinism: set is the finite option set, kept sorted and deduplicated so the minimum is set[0] and enumeration is deterministic.

Fields

§set: Arc<[Val]>
§

Error

Fields

§msg: Arc<str>

Implementations§

Source§

impl Label

Source

pub fn send(model: Model, dst: Tid, val: impl Into<Val>) -> Self

Source

pub fn recv(pred: Pred) -> Self

Blocking receive: waits for a matching message.

Source

pub fn recv_nb(pred: Pred) -> Self

Non-blocking receive: may read nothing (a timeout).

Source

pub fn nondet(set: impl IntoIterator<Item = impl Into<Val>>) -> Self

Non-deterministic choice over the finite option set set (sorted and deduplicated).

Source

pub fn error(msg: impl Into<String>) -> Self

Source

pub fn is_send(&self) -> bool

Source

pub fn is_recv(&self) -> bool

Source

pub fn is_nondet(&self) -> bool

Source

pub fn is_error(&self) -> bool

Source

pub fn model(&self) -> Option<Model>

Source

pub fn dst(&self) -> Option<Tid>

Source

pub fn val(&self) -> Option<&'static str>

A send’s payload resolved to its bytes. None for non-sends. Prefer payload when the interned handle suffices (no resolve).

Source

pub fn payload(&self) -> Option<Val>

A send’s payload as the stored (interned, Copy) Val. None for non-sends. Use val when the bytes are needed.

Source

pub fn pred(&self) -> Option<&Pred>

Source

pub fn blocking(&self) -> Option<bool>

Source

pub fn nd_set(&self) -> Option<&[Val]>

The option set of a nondet label (None for any other label). The value it resolved to is not here; that is the graph’s nd annotation.

Trait Implementations§

Source§

impl Clone for Label

Source§

fn clone(&self) -> Label

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Label

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Label

Source§

impl PartialEq for Label

Source§

fn eq(&self, other: &Label) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Label

Auto Trait Implementations§

§

impl !RefUnwindSafe for Label

§

impl !UnwindSafe for Label

§

impl Freeze for Label

§

impl Send for Label

§

impl Sync for Label

§

impl Unpin for Label

§

impl UnsafeUnpin for Label

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.