pub struct LinearityChecker { /* private fields */ }Expand description
Linearity checker for expressions.
Implementations§
Source§impl LinearityChecker
impl LinearityChecker
pub fn new() -> Self
Sourcepub fn bind(&mut self, name: impl Into<String>, linear_type: LinearType)
pub fn bind(&mut self, name: impl Into<String>, linear_type: LinearType)
Add a linear variable binding
Sourcepub fn check(&self) -> Result<(), Vec<String>>
pub fn check(&self) -> Result<(), Vec<String>>
Check if all linearity constraints are satisfied
Sourcepub fn context(&self) -> &LinearContext
pub fn context(&self) -> &LinearContext
Get the current context
Sourcepub fn context_mut(&mut self) -> &mut LinearContext
pub fn context_mut(&mut self) -> &mut LinearContext
Get a mutable reference to the context
Trait Implementations§
Source§impl Clone for LinearityChecker
impl Clone for LinearityChecker
Source§fn clone(&self) -> LinearityChecker
fn clone(&self) -> LinearityChecker
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 LinearityChecker
impl Debug for LinearityChecker
Auto Trait Implementations§
impl Freeze for LinearityChecker
impl RefUnwindSafe for LinearityChecker
impl Send for LinearityChecker
impl Sync for LinearityChecker
impl Unpin for LinearityChecker
impl UnwindSafe for LinearityChecker
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