pub struct StrippedStringSkeleton { /* private fields */ }Expand description
We want to create a stripped version of our StringSkeleton, called a StrippedStringSkeleton.
The StrippedStringSkeleton should contain a flattened list of all nodes in the model tree.
Each entry in items corresponds to one StrippedNodeData, referencing children by name if
any exist.
The StrippedStringSkeleton differs from the StringSkeleton in the following way:
StringSkeletonrepresents the full payload.- In certain cases, we need something lighter.
StrippedStringSkeletonfills this niche. - In a typical system flow, we maintain the StringSkeleton elsewhere and, although it is more computationally intensive, we can refer to it when necessary.
Here we need simply the bare scaffold.
In this structure, we do not need parameter selection justification/confidence levels.
Here we want to track each node by name with its children and its kind {Dispatch,Aggregate,LeafHolder}
- The role of this data structure is to immediately and directly indicate the shape of the model scaffold. The shape of this tree should be exactly the same as the StringSkeleton.
Here we should keep intact the information about whether or not a branch is optional.
Here we track the selection-probability field associated with each branch. We use this probability field to make decisions during randomization about which model paths to traverse and how frequently. The probability field should be set based on domain knowledge about the concrete domain represented by the tree.
§Example Output Format
Below is an example for illustration only (note how it avoids referencing a specific domain and uses placeholders instead):
[
{
"name": "CoreModule",
"kind": "Aggregate",
"descriptor": "Collects baseline components essential for broad functionality.",
"children": [
{
"name": "InitializationBlock",
"optional": false,
"probability": 1.0
},
{
"name": "LifecycleHooks",
"optional": false,
"probability": 1.0
}
]
},
{
"name": "InitializationBlock",
"kind": "Dispatch",
"descriptor": "Switches among methods for setting initial parameters or states.",
"children": [
{
"name": "ParameterSetup",
"optional": false,
"probability": 1.0
},
{
"name": "ResourceProvision",
"optional": false,
"probability": 1.0
}
]
},
{
"name": "ParameterSetup",
"kind": "LeafHolder",
"descriptor": "Defines various ways to assign base parameters before use.",
"n_leaves": 9
},
{
"name": "ResourceProvision",
"kind": "LeafHolder",
"descriptor": "Outlines techniques for supplying necessary resources or data.",
"n_leaves": 9,
"capstone": true
},
{
"name": "LifecycleHooks",
"kind": "LeafHolder",
"descriptor": "Houses event triggers or callback methods tied to major milestones.",
"n_leaves": 9
}
]When generating this structure, please keep the following information in mind:
- Output your final stripped skeleton as an array of JSON objects, one per node.
- For each node:
- Provide its
name,kind,descriptor, and if non-leaf, itschildren. - For leaf nodes, provide
n_leavesandcapstoneif applicable.
- Provide its
- Make sure descriptors are domain-focused and remain cohesive when read in a hierarchy from root to leaf.
- No fields other than the ones mentioned: no confidence, no justification, no extraneous data.
By following these guidelines, your descriptors will naturally form a coherent mini-narrative for any domain you apply them to.
Implementations§
Source§impl StrippedStringSkeleton
impl StrippedStringSkeleton
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 items(&self) -> &Vec<StrippedNodeData>
pub fn items(&self) -> &Vec<StrippedNodeData>
The complete list of nodes in the scaffold.
We require that the full shape of the original StringSkeleton is maintained, including all of its nodes and branches to full depth.
Source§impl StrippedStringSkeleton
impl StrippedStringSkeleton
Sourcepub fn set_target_name(&mut self, val: String) -> &mut Self
pub fn set_target_name(&mut self, val: String) -> &mut Self
This field holds verbatim the lower-kebab-case target-name belonging to the tree grow process.
Sourcepub fn set_items(&mut self, val: Vec<StrippedNodeData>) -> &mut Self
pub fn set_items(&mut self, val: Vec<StrippedNodeData>) -> &mut Self
The complete list of nodes in the scaffold.
We require that the full shape of the original StringSkeleton is maintained, including all of its nodes and branches to full depth.
Trait Implementations§
Source§impl AiJsonTemplate for StrippedStringSkeleton
impl AiJsonTemplate for StrippedStringSkeleton
Source§fn to_template() -> Value
fn to_template() -> Value
Source§impl Clone for StrippedStringSkeleton
impl Clone for StrippedStringSkeleton
Source§fn clone(&self) -> StrippedStringSkeleton
fn clone(&self) -> StrippedStringSkeleton
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for StrippedStringSkeleton
impl Debug for StrippedStringSkeleton
Source§impl<'de> Deserialize<'de> for StrippedStringSkeleton
impl<'de> Deserialize<'de> for StrippedStringSkeleton
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for StrippedStringSkeleton
impl Display for StrippedStringSkeleton
impl Eq for StrippedStringSkeleton
Source§impl From<&StringSkeleton> for StrippedStringSkeleton
Below is our updated From<&StringSkeleton> for StrippedStringSkeleton
implementation. We simply call promote_missing_child_nodes_with_defaults
at the start, so that none of the aggregator/dispatch children get dropped.
After that, the existing logic remains unchanged.
impl From<&StringSkeleton> for StrippedStringSkeleton
Below is our updated From<&StringSkeleton> for StrippedStringSkeleton
implementation. We simply call promote_missing_child_nodes_with_defaults
at the start, so that none of the aggregator/dispatch children get dropped.
After that, the existing logic remains unchanged.
Make sure to import the promote_missing_child_nodes_with_defaults function
in whatever module houses this impl.
Source§fn from(x: &StringSkeleton) -> Self
fn from(x: &StringSkeleton) -> Self
Source§impl From<JustifiedStringSkeleton> for StrippedStringSkeleton
impl From<JustifiedStringSkeleton> for StrippedStringSkeleton
Source§fn from(x: JustifiedStringSkeleton) -> Self
fn from(x: JustifiedStringSkeleton) -> Self
Source§impl Hash for StrippedStringSkeleton
impl Hash for StrippedStringSkeleton
Source§impl LoadFromFile for StrippedStringSkeletonwhere
StrippedStringSkeleton: for<'de> Deserialize<'de>,
impl LoadFromFile for StrippedStringSkeletonwhere
StrippedStringSkeleton: for<'de> Deserialize<'de>,
Source§impl PartialEq for StrippedStringSkeleton
impl PartialEq for StrippedStringSkeleton
Source§fn eq(&self, other: &StrippedStringSkeleton) -> bool
fn eq(&self, other: &StrippedStringSkeleton) -> bool
self and other values to be equal, and is used by ==.Source§impl SaveToFile for StrippedStringSkeletonwhere
StrippedStringSkeleton: Serialize,
impl SaveToFile for StrippedStringSkeletonwhere
StrippedStringSkeleton: Serialize,
Source§impl Serialize for StrippedStringSkeleton
impl Serialize for StrippedStringSkeleton
impl StructuralPartialEq for StrippedStringSkeleton
Auto Trait Implementations§
impl Freeze for StrippedStringSkeleton
impl RefUnwindSafe for StrippedStringSkeleton
impl Send for StrippedStringSkeleton
impl Sync for StrippedStringSkeleton
impl Unpin for StrippedStringSkeleton
impl UnsafeUnpin for StrippedStringSkeleton
impl UnwindSafe for StrippedStringSkeleton
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
impl<T> ErasedDestructor for Twhere
T: 'static,
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>
renamed to 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);Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.