PriorityComparison
Stores a safe function comparator as a concrete priority policy.
Module std.collections
import std.collections;Public declaration contracts and authored examples. A page can document several related symbols. Implementation bodies are excluded.
PriorityComparison
pub final class PriorityComparison<T>Stores a safe function comparator as a concrete priority policy.
The policy allocates nothing and never erases unsafe authorization or reference access. Positive results rank the left element higher. The function must define a consistent strict weak ordering and must not invalidate queue storage. T: Exact element type borrowed readonly during comparison.
PriorityComparison.init
pub init(Compare: fn(readonly T&, readonly T&) -> i32)Stores one safely callable function without boxing. Compare: Safe comparator preserving both readonly element borrows.
PriorityComparison.Invoke
pub readonly fn Invoke(Left: readonly T&, Right: readonly T&) -> i32Compares two live items through the stored function. Left: First readonly borrowed item. Right: Second readonly borrowed item. Return: Positive when Left outranks Right, negative when Right outranks Left, zero for a tie.