pub struct ExprArena { /* private fields */ }Implementations§
Source§impl ExprArena
impl ExprArena
pub fn new() -> ExprArena
pub fn with_capacity(cap: usize) -> ExprArena
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn push(&mut self, node: ExprNode) -> ExprId
pub fn push(&mut self, node: ExprNode) -> ExprId
§Panics
Panics if the number of expressions exceeds u32::MAX (expression arena overflow).
pub fn get(&self, id: ExprId) -> &ExprNode
pub fn get_mut(&mut self, id: ExprId) -> &mut ExprNode
pub fn nodes(&self) -> &[ExprNode]
pub fn constant(&mut self, v: f64) -> ExprId
pub fn var(&mut self, v: VarId) -> ExprId
pub fn param(&mut self, p: ParamId) -> ExprId
pub fn linear(&mut self, coeffs: Vec<(VarId, f64)>, constant: f64) -> ExprId
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ExprArena
impl RefUnwindSafe for ExprArena
impl Send for ExprArena
impl Sync for ExprArena
impl Unpin for ExprArena
impl UnsafeUnpin for ExprArena
impl UnwindSafe for ExprArena
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more