pub struct GrowerTreeConfiguration { /* private fields */ }Expand description
We set the GrowerTreeConfiguration to refine the shape of our model trees:
- Depth: # of hierarchical levels (≥1)
- Breadth: baseline sibling count (≥1)
- Density: variants at leaves (≥1)
- leaf_granularity: fraction [0..1] controlling fine detail at leaves
- balance_symmetry: fraction [0..1] controlling symmetrical vs. varied structure
- complexity: overall complexity level (simple, balanced, or complex)
Optional advanced sub-structs:
- level_specific: arrays of breadth/density overrides for each level
- weighted_branching: mean ± variance approach
- level_skipping: per-level leaf probabilities
- capstone: highlight nodes (off, single, or fraction)
- ordering: sub-branch sorting approach
- ai_confidence: modifies branch factor based on AI certainty
New fields:
- aggregator_preference: fraction [0..1] controlling how often aggregator is used vs. dispatch
- allow_early_leaves: if true, allows leaf nodes to appear before the final depth
- partial_subbranch_probability: fraction [0..1] controlling how often each child sub-branch is included
- tree_expansion_policy: advanced logic for picking among aggregator/dispatch/leaf
- aggregator_depth_limit, dispatch_depth_limit, leaf_min_depth: optional constraints on usage of aggregator, dispatch, or leaf nodes by depth
Your justification must indicate why each justified parameter value was chosen deliberately by using knowledge and an understanding of the target domain as a guide. Since each target domain is different, the trees which map them will have different shapes and different GrowerTreeConfiguration parameters. Your job during justification is to explain clearly why a given parameter setting makes sense in the provided target domain.
Implementations§
Source§impl GrowerTreeConfiguration
impl GrowerTreeConfiguration
Sourcepub fn base_config(
depth: u8,
breadth: u8,
density: u8,
) -> GrowerTreeConfiguration
pub fn base_config( depth: u8, breadth: u8, density: u8, ) -> GrowerTreeConfiguration
Creates a minimal config with the given core fields.
Sourcepub fn to_builder(&self) -> GrowerTreeConfigurationBuilder
pub fn to_builder(&self) -> GrowerTreeConfigurationBuilder
Convert the existing config into a builder, copying all fields.
Sourcepub fn with_ai_conf(
self,
base_factor: u8,
factor_multiplier: f32,
) -> GrowerTreeConfiguration
pub fn with_ai_conf( self, base_factor: u8, factor_multiplier: f32, ) -> GrowerTreeConfiguration
Attaches an AI-confidence sub-struct, returning a new config.
Sourcepub fn with_weighted_branching(
self,
mean: u8,
variance: u8,
) -> GrowerTreeConfiguration
pub fn with_weighted_branching( self, mean: u8, variance: u8, ) -> GrowerTreeConfiguration
Attaches WeightedBranching with the given mean/variance.
Sourcepub fn with_level_skipping(
self,
skip_probs: Vec<f32>,
) -> GrowerTreeConfiguration
pub fn with_level_skipping( self, skip_probs: Vec<f32>, ) -> GrowerTreeConfiguration
Attaches LevelSkipping with the given skip probabilities.
Sourcepub fn with_level_specific(
self,
bpl: Vec<u8>,
dpl: Vec<u8>,
) -> GrowerTreeConfiguration
pub fn with_level_specific( self, bpl: Vec<u8>, dpl: Vec<u8>, ) -> GrowerTreeConfiguration
Attaches LevelSpecific with the given breadth/density arrays.
Sourcepub fn with_capstone(
self,
mode: CapstoneMode,
prob: f32,
) -> GrowerTreeConfiguration
pub fn with_capstone( self, mode: CapstoneMode, prob: f32, ) -> GrowerTreeConfiguration
Attaches a Capstone sub-struct with the given mode/prob.
Source§impl GrowerTreeConfiguration
impl GrowerTreeConfiguration
Sourcepub fn target_name(&self) -> &String
pub fn target_name(&self) -> &String
This field holds verbatim the lower-kebab-case target-name belonging to the tree grow process.
Sourcepub fn depth(&self) -> &u8
pub fn depth(&self) -> &u8
Set this integer to define how many levels exist from root to leaf in the tree (≥5).
- Setting a higher number → deeper specialization (depth).
- Setting a lower number → simpler, more general modeling.
Sourcepub fn breadth(&self) -> &u8
pub fn breadth(&self) -> &u8
Set this integer to define how many siblings or sub-branches each node has by default (≥7).
- Higher → broad coverage, e.g. “Spread (Loosen).”
- Lower → narrower, e.g. “Narrow (Tighten).”
Sourcepub fn density(&self) -> &u8
pub fn density(&self) -> &u8
Set this integer to define how many variants (children) each leaf node holds by default (≥9).
- Higher → more fullness (“Dense”).
- Lower → sparser representation (“Sparse”).
Sourcepub fn leaf_granularity(&self) -> &f32
pub fn leaf_granularity(&self) -> &f32
Set this fraction [0..1] to specify how finely detailed each leaf item becomes.
- 0 = coarse (broad, less specialized leaves),
- 1 = extremely specific leaves.
Sourcepub fn balance_symmetry(&self) -> &f32
pub fn balance_symmetry(&self) -> &f32
Set this fraction [0..1] to numerically characerize the symmetrical vs. unbalanced structure of our tree.
- 0.0 = random/unbalanced,
- 1.0 = perfectly balanced.
Sourcepub fn complexity(&self) -> &ConfigurationComplexity
pub fn complexity(&self) -> &ConfigurationComplexity
Set this field to select between “simple”, “balanced”, or “complex” for overall usage patterns.
Sourcepub fn level_specific(&self) -> &Option<TreeLevelSpecificConfiguration>
pub fn level_specific(&self) -> &Option<TreeLevelSpecificConfiguration>
Set this optional sub-struct to specify the arrays for per-level breadth & density overrides.
Sourcepub fn weighted_branching(&self) -> &Option<WeightedBranchingConfiguration>
pub fn weighted_branching(&self) -> &Option<WeightedBranchingConfiguration>
Set this optional sub-struct to define mean ± variance if you want random branching factors.
Sourcepub fn level_skipping(&self) -> &Option<LevelSkippingConfiguration>
pub fn level_skipping(&self) -> &Option<LevelSkippingConfiguration>
Set this optional sub-struct to define probabilities for skipping deeper expansions at certain levels.
Sourcepub fn capstone(&self) -> &Option<CapstoneGenerationConfiguration>
pub fn capstone(&self) -> &Option<CapstoneGenerationConfiguration>
Set this optional sub-struct to define the characteristics of capstone leaves, how many of them there are, and our chances of encountering one at any given level.
Sourcepub fn ordering(&self) -> &Option<SubBranchOrdering>
pub fn ordering(&self) -> &Option<SubBranchOrdering>
Set this optional sub-struct to define how sub-branches get ordered (alphabetical, difficulty, random).
Sourcepub fn ai_confidence(&self) -> &Option<AiTreeBranchingConfidenceConfiguration>
pub fn ai_confidence(&self) -> &Option<AiTreeBranchingConfidenceConfiguration>
Set this optional sub-struct to define how AI confidence modifies branch factor (if any).
Sourcepub fn aggregator_preference(&self) -> &f32
pub fn aggregator_preference(&self) -> &f32
Set this fraction [0..1] to control how often aggregator nodes are used vs. dispatch nodes at intermediate levels.
- 0.0 => always dispatch
- 1.0 => always aggregator
- 0.5 => half aggregator, half dispatch
This is a simplistic alternative to tree_expansion_policy. If tree_expansion_policy is set to something
more advanced, this field might be ignored or used as a fallback.
Sourcepub fn allow_early_leaves(&self) -> &bool
pub fn allow_early_leaves(&self) -> &bool
If true, leaf nodes may appear before the final depth, i.e. some sub-branches might terminate
early with a LeafHolder.
If false, all leaves appear exactly at depth.
Sourcepub fn partial_subbranch_probability(&self) -> &f32
pub fn partial_subbranch_probability(&self) -> &f32
Fraction [0..1] controlling how often each potential child sub-branch is included.
- 0.0 => no optional sub-branches
- 1.0 => all sub-branches are included
This might tie into ChildSpec optional or probability fields, e.g. randomizing
which children appear.
Sourcepub fn tree_expansion_policy(&self) -> &TreeExpansionPolicy
pub fn tree_expansion_policy(&self) -> &TreeExpansionPolicy
An advanced enum describing how to pick among Dispatch, Aggregate, or LeafHolder
at each level.
- If you set this to
NodeVariantStrategy::Simple, you get a straightforward approach where we do dispatch at intermediate nodes and leaves at final depth. - If you use
Weighted, you can do random picks among aggregator/dispatch/leaf. - If you do
DepthBased, you can specify exactly which level to start aggregator vs. leaf.
Sourcepub fn aggregator_depth_limit(&self) -> &Option<u8>
pub fn aggregator_depth_limit(&self) -> &Option<u8>
If set, aggregator nodes will not appear deeper than this level.
If None, no limit.
If Some(n), aggregator variant is disallowed for levels > n.
Sourcepub fn dispatch_depth_limit(&self) -> &Option<u8>
pub fn dispatch_depth_limit(&self) -> &Option<u8>
If set, dispatch nodes will not appear deeper than this level.
If None, no limit.
If Some(n), dispatch variant is disallowed for levels > n.
Sourcepub fn leaf_min_depth(&self) -> &Option<u8>
pub fn leaf_min_depth(&self) -> &Option<u8>
If set, leaf-holder nodes cannot appear before this level (forces deeper expansions).
If None, no minimum.
If Some(n), we skip leaf-holder variants until level ≥ n.
Source§impl GrowerTreeConfiguration
impl GrowerTreeConfiguration
Sourcepub fn validate(&self) -> Result<(), GrowerTreeConfigurationError>
pub fn validate(&self) -> Result<(), GrowerTreeConfigurationError>
This function should validate all fields: baseline parameters and each advanced sub-struct if present. Returns an error if any invalid configuration is detected.
Sourcepub fn from_toml_str(
s: &str,
) -> Result<GrowerTreeConfiguration, GrowerTreeConfigurationError>
pub fn from_toml_str( s: &str, ) -> Result<GrowerTreeConfiguration, GrowerTreeConfigurationError>
This function should parse a GrowerTreeConfiguration from TOML string input.
Sourcepub fn to_toml_string(&self) -> Result<String, GrowerTreeConfigurationError>
pub fn to_toml_string(&self) -> Result<String, GrowerTreeConfigurationError>
This function should convert the GrowerTreeConfiguration into a pretty TOML string.
Sourcepub fn from_toml_file<P>(
path: P,
) -> Result<GrowerTreeConfiguration, GrowerTreeConfigurationError>
pub fn from_toml_file<P>( path: P, ) -> Result<GrowerTreeConfiguration, GrowerTreeConfigurationError>
This function should load a GrowerTreeConfiguration from a TOML file on disk.
Sourcepub fn to_toml_file<P>(
&self,
path: P,
) -> Result<(), GrowerTreeConfigurationError>
pub fn to_toml_file<P>( &self, path: P, ) -> Result<(), GrowerTreeConfigurationError>
This function should write the GrowerTreeConfiguration to a file in TOML format.
Trait Implementations§
Source§impl AiJsonTemplate for GrowerTreeConfiguration
impl AiJsonTemplate for GrowerTreeConfiguration
Source§fn to_template() -> Value
fn to_template() -> Value
Source§impl Clone for GrowerTreeConfiguration
impl Clone for GrowerTreeConfiguration
Source§fn clone(&self) -> GrowerTreeConfiguration
fn clone(&self) -> GrowerTreeConfiguration
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl CompareAggregatorPreference for GrowerTreeConfiguration
impl CompareAggregatorPreference for GrowerTreeConfiguration
fn compare_aggregator_preference( &self, other: &GrowerTreeConfiguration, ) -> CompareOutcome
Source§impl CompareAiConfidence for GrowerTreeConfiguration
impl CompareAiConfidence for GrowerTreeConfiguration
fn compare_ai_confidence( &self, other: &GrowerTreeConfiguration, ) -> CompareOutcome
Source§impl CompareAllowEarlyLeaves for GrowerTreeConfiguration
impl CompareAllowEarlyLeaves for GrowerTreeConfiguration
fn compare_allow_early_leaves( &self, other: &GrowerTreeConfiguration, ) -> CompareOutcome
Source§impl CompareBalanceSymmetry for GrowerTreeConfiguration
impl CompareBalanceSymmetry for GrowerTreeConfiguration
fn compare_balance_symmetry( &self, other: &GrowerTreeConfiguration, ) -> CompareOutcome
Source§impl CompareBreadth for GrowerTreeConfiguration
impl CompareBreadth for GrowerTreeConfiguration
fn compare_breadth(&self, other: &GrowerTreeConfiguration) -> CompareOutcome
Source§impl CompareCapstone for GrowerTreeConfiguration
impl CompareCapstone for GrowerTreeConfiguration
fn compare_capstone(&self, other: &GrowerTreeConfiguration) -> CompareOutcome
Source§impl CompareComplexity for GrowerTreeConfiguration
impl CompareComplexity for GrowerTreeConfiguration
fn compare_complexity(&self, other: &GrowerTreeConfiguration) -> CompareOutcome
Source§impl CompareDensity for GrowerTreeConfiguration
impl CompareDensity for GrowerTreeConfiguration
fn compare_density(&self, other: &GrowerTreeConfiguration) -> CompareOutcome
Source§impl CompareDepth for GrowerTreeConfiguration
impl CompareDepth for GrowerTreeConfiguration
fn compare_depth(&self, other: &GrowerTreeConfiguration) -> CompareOutcome
Source§impl CompareDepthLimits for GrowerTreeConfiguration
impl CompareDepthLimits for GrowerTreeConfiguration
fn compare_depth_limits( &self, other: &GrowerTreeConfiguration, ) -> CompareOutcome
Source§impl CompareFullConfiguration for GrowerTreeConfiguration
impl CompareFullConfiguration for GrowerTreeConfiguration
fn compare_config_to(&self, other: &GrowerTreeConfiguration) -> CompareOutcome
Source§impl CompareLeafGranularity for GrowerTreeConfiguration
impl CompareLeafGranularity for GrowerTreeConfiguration
fn compare_leaf_granularity( &self, other: &GrowerTreeConfiguration, ) -> CompareOutcome
Source§impl CompareLevelSkipping for GrowerTreeConfiguration
impl CompareLevelSkipping for GrowerTreeConfiguration
fn compare_level_skipping( &self, other: &GrowerTreeConfiguration, ) -> CompareOutcome
Source§impl CompareLevelSpecific for GrowerTreeConfiguration
impl CompareLevelSpecific for GrowerTreeConfiguration
fn compare_level_specific( &self, other: &GrowerTreeConfiguration, ) -> CompareOutcome
Source§impl ComparePartialSubbranchProbability for GrowerTreeConfiguration
impl ComparePartialSubbranchProbability for GrowerTreeConfiguration
fn compare_partial_subbranch_probability( &self, other: &GrowerTreeConfiguration, ) -> CompareOutcome
Source§impl CompareSubBranchOrdering for GrowerTreeConfiguration
impl CompareSubBranchOrdering for GrowerTreeConfiguration
fn compare_sub_branch_ordering( &self, other: &GrowerTreeConfiguration, ) -> CompareOutcome
Source§impl CompareTreeExpansionPolicy for GrowerTreeConfiguration
impl CompareTreeExpansionPolicy for GrowerTreeConfiguration
fn compare_tree_expansion_policy( &self, other: &GrowerTreeConfiguration, ) -> CompareOutcome
Source§impl CompareWeightedBranching for GrowerTreeConfiguration
impl CompareWeightedBranching for GrowerTreeConfiguration
fn compare_weighted_branching( &self, other: &GrowerTreeConfiguration, ) -> CompareOutcome
Source§impl Debug for GrowerTreeConfiguration
impl Debug for GrowerTreeConfiguration
Source§impl Default for GrowerTreeConfiguration
impl Default for GrowerTreeConfiguration
Source§fn default() -> GrowerTreeConfiguration
fn default() -> GrowerTreeConfiguration
Source§impl<'de> Deserialize<'de> for GrowerTreeConfiguration
impl<'de> Deserialize<'de> for GrowerTreeConfiguration
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<GrowerTreeConfiguration, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<GrowerTreeConfiguration, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl From<JustifiedGrowerTreeConfiguration> for GrowerTreeConfiguration
impl From<JustifiedGrowerTreeConfiguration> for GrowerTreeConfiguration
Source§fn from(value: JustifiedGrowerTreeConfiguration) -> GrowerTreeConfiguration
fn from(value: JustifiedGrowerTreeConfiguration) -> GrowerTreeConfiguration
Source§impl LoadFromFile for GrowerTreeConfigurationwhere
GrowerTreeConfiguration: for<'de> Deserialize<'de>,
impl LoadFromFile for GrowerTreeConfigurationwhere
GrowerTreeConfiguration: for<'de> Deserialize<'de>,
type Error = SaveLoadError
fn load_from_file<'async_trait>(
filename: impl AsRef<Path> + Send + 'async_trait,
) -> Pin<Box<dyn Future<Output = Result<GrowerTreeConfiguration, <GrowerTreeConfiguration as LoadFromFile>::Error>> + Send + 'async_trait>>where
GrowerTreeConfiguration: 'async_trait,
Source§impl PartialEq for GrowerTreeConfiguration
impl PartialEq for GrowerTreeConfiguration
Source§impl SaveToFile for GrowerTreeConfigurationwhere
GrowerTreeConfiguration: Serialize,
impl SaveToFile for GrowerTreeConfigurationwhere
GrowerTreeConfiguration: Serialize,
type Error = SaveLoadError
fn save_to_file<'life0, 'async_trait>(
&'life0 self,
filename: impl AsRef<Path> + Send + 'async_trait,
) -> Pin<Box<dyn Future<Output = Result<(), <GrowerTreeConfiguration as SaveToFile>::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
GrowerTreeConfiguration: 'async_trait,
Source§impl Serialize for GrowerTreeConfiguration
impl Serialize for GrowerTreeConfiguration
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for GrowerTreeConfiguration
Auto Trait Implementations§
impl Freeze for GrowerTreeConfiguration
impl RefUnwindSafe for GrowerTreeConfiguration
impl Send for GrowerTreeConfiguration
impl Sync for GrowerTreeConfiguration
impl Unpin for GrowerTreeConfiguration
impl UnwindSafe for GrowerTreeConfiguration
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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> IntoCollection<T> for T
impl<T> IntoCollection<T> for T
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> ⓘ
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> ⓘ
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 moreSource§impl<T> LoadFromDirectory for Twhere
T: LoadFromFile + Send,
<T as LoadFromFile>::Error: Display + From<SaveLoadError> + From<Error> + Send + 'static,
impl<T> LoadFromDirectory for Twhere
T: LoadFromFile + Send,
<T as LoadFromFile>::Error: Display + From<SaveLoadError> + From<Error> + Send + 'static,
Source§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the foreground set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red() and
green(), which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg():
use yansi::{Paint, Color};
painted.fg(Color::White);Set foreground color to white using white().
use yansi::Paint;
painted.white();Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the background set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red() and
on_green(), which have the same functionality but
are pithier.
§Example
Set background color to red using fg():
use yansi::{Paint, Color};
painted.bg(Color::Red);Set background color to red using on_red().
use yansi::Paint;
painted.on_red();Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute value.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold() and
underline(), which have the same functionality
but are pithier.
§Example
Make text bold using attr():
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);Make text bold using using bold().
use yansi::Paint;
painted.bold();Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi Quirk value.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask() and
wrap(), which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk():
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);Enable wrapping using wrap().
use yansi::Paint;
painted.wrap();Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
fn clear(&self) -> Painted<&T>
resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted only when both stdout and stderr are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);