pub enum LinearKind {
Unrestricted,
Linear,
Affine,
Relevant,
}Expand description
The kind of linearity constraint.
Variants§
Unrestricted
Unrestricted: can be used any number of times (standard types)
Linear
Linear: must be used exactly once
Affine
Affine: can be used at most once (can be dropped)
Relevant
Relevant: must be used at least once (can be copied)
Implementations§
Source§impl LinearKind
impl LinearKind
Sourcepub fn allows_copy(&self) -> bool
pub fn allows_copy(&self) -> bool
Check if this kind allows copying.
Sourcepub fn allows_drop(&self) -> bool
pub fn allows_drop(&self) -> bool
Check if this kind allows dropping without use.
Sourcepub fn requires_use(&self) -> bool
pub fn requires_use(&self) -> bool
Check if this kind requires at least one use.
Sourcepub fn limits_use(&self) -> bool
pub fn limits_use(&self) -> bool
Check if this kind limits to at most one use.
Sourcepub fn join(&self, other: &LinearKind) -> LinearKind
pub fn join(&self, other: &LinearKind) -> LinearKind
Get the join (least upper bound) of two kinds.
Sourcepub fn meet(&self, other: &LinearKind) -> LinearKind
pub fn meet(&self, other: &LinearKind) -> LinearKind
Get the meet (greatest lower bound) of two kinds.
Trait Implementations§
Source§impl Clone for LinearKind
impl Clone for LinearKind
Source§fn clone(&self) -> LinearKind
fn clone(&self) -> LinearKind
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LinearKind
impl Debug for LinearKind
Source§impl Display for LinearKind
impl Display for LinearKind
Source§impl Hash for LinearKind
impl Hash for LinearKind
Source§impl PartialEq for LinearKind
impl PartialEq for LinearKind
impl Copy for LinearKind
impl Eq for LinearKind
impl StructuralPartialEq for LinearKind
Auto Trait Implementations§
impl Freeze for LinearKind
impl RefUnwindSafe for LinearKind
impl Send for LinearKind
impl Sync for LinearKind
impl Unpin for LinearKind
impl UnwindSafe for LinearKind
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.