Skip to main content

CaseId

Struct CaseId 

Source
pub struct CaseId<K> { /* private fields */ }
Expand description

Identifies a case in a case-centric (XES-style) log.

CaseId and TraceId are intentionally distinct: CaseId names the case attribute as parsed from an external format (e.g. XES concept:name), while TraceId names a structural trace position within an already-admitted crate::eventlog::EventLog. Mixing them is a compile error, not a naming convention.

Zero-cost #[repr(transparent)] wrapper carrying a PhantomData<K> kind marker. Structure-only: it names an entity, it does not resolve or validate the link. Graduate to wasm4pm to dereference it.

Implementations§

Source§

impl<K> CaseId<K>

Source

pub const fn new(raw: u64) -> Self

Wraps a raw u64 as a typed CaseId.

§Examples
use wasm4pm_compat::ids::CaseId;
enum Local {}
let id = CaseId::<Local>::new(7);
assert_eq!(id.raw(), 7);
Source

pub const fn raw(self) -> u64

Returns the underlying raw u64.

§Examples
use wasm4pm_compat::ids::CaseId;
enum Local {}
assert_eq!(CaseId::<Local>::new(42).raw(), 42);
Source

pub const fn into_inner(self) -> u64

Consumes self and returns the underlying raw u64 value.

Identical to raw; provided for newtype-wrapper ergonomics so callers can use the same into_inner() idiom across all ID kinds.

§Examples
use wasm4pm_compat::ids::CaseId;
enum Local {}
assert_eq!(CaseId::<Local>::new(5).into_inner(), 5);
Source

pub const fn as_inner(&self) -> &u64

Borrows the underlying raw u64 value.

Identical to AsRef but using the newtype-wrapper ergonomic name as_inner() so callers can use a consistent idiom across all ID kinds.

§Examples
use wasm4pm_compat::ids::CaseId;
enum Local {}
assert_eq!(*CaseId::<Local>::new(9).as_inner(), 9);

Trait Implementations§

Source§

impl<K> AsRef<u64> for CaseId<K>

Source§

fn as_ref(&self) -> &u64

Borrows the underlying raw value without copying.

Source§

impl<K> Clone for CaseId<K>

Source§

fn clone(&self) -> Self

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<K> Copy for CaseId<K>

Source§

impl<K> Debug for CaseId<K>

Source§

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

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

impl<K> Display for CaseId<K>

Displays the raw numeric value prefixed by the type name, e.g. EventId(7).

Source§

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

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

impl<K> Eq for CaseId<K>

Source§

impl<K> From<CaseId<K>> for u64

Source§

fn from(id: CaseId<K>) -> u64

Unwraps the typed id back to its raw primitive. Infallible.

Source§

impl<K> From<u64> for CaseId<K>

Source§

fn from(raw: u64) -> Self

Wraps a raw primitive as a typed id. Infallible.

Source§

impl<K> FromStr for CaseId<K>

Source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses the decimal representation of the raw primitive.

§Errors

Returns the same error as $raw::from_str when the string is not a valid decimal integer.

Source§

type Err = <u64 as FromStr>::Err

The associated error which can be returned from parsing.
Source§

impl<K> Hash for CaseId<K>

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<K> NewFromRaw for CaseId<K>

Source§

type Raw = u64

The underlying raw primitive (same as TypedId::Raw).
Source§

fn new_from_raw(raw: u64) -> Self

Constructs Self from a raw primitive. Identical to the concrete new fn.
Source§

impl<K> Ord for CaseId<K>

Source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl<K> PartialEq for CaseId<K>

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<K> PartialOrd for CaseId<K>

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<K> TypedId for CaseId<K>

Source§

type Raw = u64

The underlying raw primitive type (u64 or u32).
Source§

fn raw_value(&self) -> u64

Returns the underlying raw value.
Source§

fn is_zero(&self) -> bool

Returns true when the raw value is the zero sentinel. Read more

Auto Trait Implementations§

§

impl<K> Freeze for CaseId<K>

§

impl<K> RefUnwindSafe for CaseId<K>
where K: RefUnwindSafe,

§

impl<K> Send for CaseId<K>
where K: Send,

§

impl<K> Sync for CaseId<K>
where K: Sync,

§

impl<K> Unpin for CaseId<K>
where K: Unpin,

§

impl<K> UnsafeUnpin for CaseId<K>

§

impl<K> UnwindSafe for CaseId<K>
where K: UnwindSafe,

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> EvidenceKind for T

Source§

default fn kind_label(&self) -> &'static str

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.