Struct tract_libcli::display_params::DisplayParams
source · pub struct DisplayParams {Show 16 fields
pub konst: bool,
pub invariants: bool,
pub quiet: bool,
pub natural_order: bool,
pub debug_op: bool,
pub cost: bool,
pub profile: bool,
pub node_ids: Option<Vec<TVec<(usize, String)>>>,
pub op_name: Option<String>,
pub node_name: Option<String>,
pub expect_core: bool,
pub outlet_labels: bool,
pub io: Io,
pub json: bool,
pub info: bool,
pub left_column_width: usize,
}Fields§
§konst: bool§invariants: bool§quiet: bool§natural_order: bool§debug_op: bool§cost: bool§profile: bool§node_ids: Option<Vec<TVec<(usize, String)>>>§op_name: Option<String>§node_name: Option<String>§expect_core: bool§outlet_labels: bool§io: Io§json: bool§info: bool§left_column_width: usizeImplementations§
source§impl DisplayParams
impl DisplayParams
sourcepub fn filter(
&self,
model: &dyn Model,
scope: &[(usize, String)],
node_id: usize
) -> TractResult<bool>
pub fn filter(
&self,
model: &dyn Model,
scope: &[(usize, String)],
node_id: usize
) -> TractResult<bool>
Examples found in repository?
src/terminal.rs (line 56)
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
fn render_prefixed(
model: &dyn Model,
prefix: &str,
scope: &[(usize, String)],
annotations: &Annotations,
options: &DisplayParams,
) -> TractResult<()> {
let mut drawing_state =
if options.should_draw() { Some(DrawingState::default()) } else { None };
let node_ids = if options.natural_order {
(0..model.nodes_len()).collect()
} else {
model.eval_order()?
};
for node in node_ids {
if options.filter(model, scope, node)? {
render_node_prefixed(
model,
prefix,
scope,
node,
drawing_state.as_mut(),
annotations,
options,
)?
} else if let Some(ref mut ds) = drawing_state {
let _prefix = ds.draw_node_vprefix(model, node, options)?;
let _body = ds.draw_node_body(model, node, options)?;
let _suffix = ds.draw_node_vsuffix(model, node, options)?;
}
}
Ok(())
}sourcepub fn should_draw(&self) -> bool
pub fn should_draw(&self) -> bool
Examples found in repository?
src/terminal.rs (line 49)
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
fn render_prefixed(
model: &dyn Model,
prefix: &str,
scope: &[(usize, String)],
annotations: &Annotations,
options: &DisplayParams,
) -> TractResult<()> {
let mut drawing_state =
if options.should_draw() { Some(DrawingState::default()) } else { None };
let node_ids = if options.natural_order {
(0..model.nodes_len()).collect()
} else {
model.eval_order()?
};
for node in node_ids {
if options.filter(model, scope, node)? {
render_node_prefixed(
model,
prefix,
scope,
node,
drawing_state.as_mut(),
annotations,
options,
)?
} else if let Some(ref mut ds) = drawing_state {
let _prefix = ds.draw_node_vprefix(model, node, options)?;
let _body = ds.draw_node_body(model, node, options)?;
let _suffix = ds.draw_node_vsuffix(model, node, options)?;
}
}
Ok(())
}Trait Implementations§
source§impl Clone for DisplayParams
impl Clone for DisplayParams
source§fn clone(&self) -> DisplayParams
fn clone(&self) -> DisplayParams
Returns a copy 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 DisplayParams
impl Debug for DisplayParams
source§impl Default for DisplayParams
impl Default for DisplayParams
source§fn default() -> DisplayParams
fn default() -> DisplayParams
Returns the “default value” for a type. Read more
source§impl PartialEq<DisplayParams> for DisplayParams
impl PartialEq<DisplayParams> for DisplayParams
source§fn eq(&self, other: &DisplayParams) -> bool
fn eq(&self, other: &DisplayParams) -> bool
This method tests for
self and other values to be equal, and is used
by ==.impl Eq for DisplayParams
impl StructuralEq for DisplayParams
impl StructuralPartialEq for DisplayParams
Auto Trait Implementations§
impl RefUnwindSafe for DisplayParams
impl Send for DisplayParams
impl Sync for DisplayParams
impl Unpin for DisplayParams
impl UnwindSafe for DisplayParams
Blanket Implementations§
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.