#[non_exhaustive]pub struct TraceSpec { /* private fields */ }Expand description
Plain trace settings as written in a persona or workflow file. Input: categories, content flag and an optional file path. Output: getters; the default is every category, no content, no file.
Implementations§
Source§impl TraceSpec
impl TraceSpec
Sourcepub fn new(categories: TraceSet) -> TraceSpec
pub fn new(categories: TraceSet) -> TraceSpec
Returns a spec for categories, with content off and no file.
Input: the categories. Output: the spec.
Sourcepub fn with_content(self, content: bool) -> TraceSpec
pub fn with_content(self, content: bool) -> TraceSpec
Returns this spec with prompt and reply text kept or withheld. Input: true to keep content. Output: the spec.
Sourcepub fn with_file(self, file: impl Into<String>) -> TraceSpec
pub fn with_file(self, file: impl Into<String>) -> TraceSpec
Returns this spec writing to file. The path is not checked here.
Input: the file path. Output: the spec.
Sourcepub fn categories(&self) -> TraceSet
pub fn categories(&self) -> TraceSet
Returns the categories. Input: none. Output: the set.
Sourcepub fn file(&self) -> Option<&str>
pub fn file(&self) -> Option<&str>
Returns the file path, if set. Input: none. Output: the path.
Sourcepub fn parse_value<I, S>(items: I) -> Result<TraceSpec, TraceError>
pub fn parse_value<I, S>(items: I) -> Result<TraceSpec, TraceError>
Parses a TOML trace value given as one string or a list of strings.
"all" or "true" is every category, "false" or "none" is none,
any other item is a category name. Input: at most 64 items.
Output: a spec with those categories, or the first bad item.