pub struct Optimizer { /* private fields */ }Expand description
Main optimizer that applies optimization passes to a graph
Implementations§
Source§impl Optimizer
impl Optimizer
Sourcepub fn new(level: OptimizationLevel) -> Self
pub fn new(level: OptimizationLevel) -> Self
Create a new optimizer with the specified optimization level
Sourcepub fn optimize(&self, graph: &mut ModelGraph) -> Result<OptimizationStats>
pub fn optimize(&self, graph: &mut ModelGraph) -> Result<OptimizationStats>
Optimize a model graph
Sourcepub fn pass_count(&self) -> usize
pub fn pass_count(&self) -> usize
Get the number of registered passes
Sourcepub fn level(&self) -> OptimizationLevel
pub fn level(&self) -> OptimizationLevel
Get the optimization level
Auto Trait Implementations§
impl Freeze for Optimizer
impl !RefUnwindSafe for Optimizer
impl Send for Optimizer
impl Sync for Optimizer
impl Unpin for Optimizer
impl !UnwindSafe for Optimizer
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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