#[non_exhaustive]pub enum LinearDiscipline {
Linear,
Affine,
Relevant,
Unrestricted,
}Expand description
Substructural-type discipline applied to one buffer or value.
Mirrors vyre_foundation::ir::LinearType but lives at the
primitive layer so external crates (the type-checker pass, future
effect-system frontends, external analyzer rule lowering) can refer to the
discipline without pulling in the IR.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Linear
Exactly one use. uses == 1 is the only legal count.
Affine
At most one use. uses <= 1.
Relevant
At least one use. uses >= 1.
Unrestricted
No discipline. Any uses count is permitted.
Implementations§
Source§impl LinearDiscipline
impl LinearDiscipline
Sourcepub const fn forbids_drop(self) -> bool
pub const fn forbids_drop(self) -> bool
Whether this discipline forbids dropping a buffer without using
it (Linear or Relevant).
Sourcepub const fn forbids_reuse(self) -> bool
pub const fn forbids_reuse(self) -> bool
Whether this discipline forbids using a buffer more than once
(Linear or Affine).
Trait Implementations§
Source§impl Clone for LinearDiscipline
impl Clone for LinearDiscipline
Source§fn clone(&self) -> LinearDiscipline
fn clone(&self) -> LinearDiscipline
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for LinearDiscipline
Source§impl Debug for LinearDiscipline
impl Debug for LinearDiscipline
impl Eq for LinearDiscipline
Source§impl Hash for LinearDiscipline
impl Hash for LinearDiscipline
Source§impl PartialEq for LinearDiscipline
impl PartialEq for LinearDiscipline
impl StructuralPartialEq for LinearDiscipline
Auto Trait Implementations§
impl Freeze for LinearDiscipline
impl RefUnwindSafe for LinearDiscipline
impl Send for LinearDiscipline
impl Sync for LinearDiscipline
impl Unpin for LinearDiscipline
impl UnsafeUnpin for LinearDiscipline
impl UnwindSafe for LinearDiscipline
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
Compare self to
key and return true if they are equal.