pub enum Protocol {
Display,
Compare,
Iterate,
}Expand description
One entry of the closed protocol registry (stdlib-spec §9.6). The enum is the registry: adding an entry is a compiler change by construction.
Variants§
Display
fn display(self: T): string, row ⊆ pure·silent·total. Feeds the
§1.6 display boundary; F1 (ruled 2026-07-19): BOTH interpolation
and the string() conversion intrinsic dispatch through this one
path (brink-runtime::value_ops::stringify is the runtime seam).
Compare
fn compare(a: T, b: T): int, row ⊆ pure·silent·total. Slots user
types into the §4b ordering doctrine; no structural default.
Iterate
Pull-shaped iteration: next(ref Self): Option[T], row ⊆
writes-receiver·silent·total, laws attached (“every element once;
none terminal and sticky” — property-harness enforced in
brink-runtime::iter).
Implementations§
Source§impl Protocol
impl Protocol
Sourcepub fn method_name(self) -> &'static str
pub fn method_name(self) -> &'static str
The protocol’s reserved method name (F6): the name an impl answers to, and the name authors may not declare.
Sourcepub fn protocol_name(self) -> &'static str
pub fn protocol_name(self) -> &'static str
Human-readable name of the protocol itself (diagnostics).
Sourcepub fn receiver_is_ref(self) -> bool
pub fn receiver_is_ref(self) -> bool
Whether the receiver (first) parameter must be ref. Only
iterate’s next mutates its receiver — that write is a ref
param write, invisible to the global effect row, which is why one
row bound (EffectRow::is_empty) serves all three contracts.
Sourcepub fn contract_phrase(self) -> &'static str
pub fn contract_phrase(self) -> &'static str
The contract phrase used in diagnostics.
Trait Implementations§
impl Copy for Protocol
impl Eq for Protocol
Source§impl Ord for Protocol
impl Ord for Protocol
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for Protocol
impl PartialOrd for Protocol
impl StructuralPartialEq for Protocol
Auto Trait Implementations§
impl Freeze for Protocol
impl RefUnwindSafe for Protocol
impl Send for Protocol
impl Sync for Protocol
impl Unpin for Protocol
impl UnsafeUnpin for Protocol
impl UnwindSafe for Protocol
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.