pub struct Classification {
pub is_compilation: bool,
pub confidence: f64,
pub kind: Option<CompilationKind>,
pub reason: Cow<'static, str>,
pub command_prefix: Option<String>,
pub extracted_command: Option<String>,
}Expand description
Result of command classification.
Fields§
§is_compilation: boolWhether this is a compilation command.
confidence: f64Confidence score (0.0-1.0).
kind: Option<CompilationKind>The kind of compilation if detected.
reason: Cow<'static, str>Reason for the classification decision.
command_prefix: Option<String>For compound commands (e.g., “cd /path && cargo build”), this contains the prefix that should run before the compilation (“cd /path && “). None for simple commands.
extracted_command: Option<String>For compound commands, this contains the extracted compilation command (e.g., “cargo build –release”). None for simple commands where the entire input is the compilation command.
Implementations§
Source§impl Classification
impl Classification
Sourcepub fn not_compilation(reason: impl Into<Cow<'static, str>>) -> Self
pub fn not_compilation(reason: impl Into<Cow<'static, str>>) -> Self
Create a non-compilation classification.
Sourcepub fn compilation(
kind: CompilationKind,
confidence: f64,
reason: impl Into<Cow<'static, str>>,
) -> Self
pub fn compilation( kind: CompilationKind, confidence: f64, reason: impl Into<Cow<'static, str>>, ) -> Self
Create a compilation classification.
Sourcepub fn compound_compilation(
kind: CompilationKind,
confidence: f64,
reason: impl Into<Cow<'static, str>>,
prefix: String,
extracted: String,
) -> Self
pub fn compound_compilation( kind: CompilationKind, confidence: f64, reason: impl Into<Cow<'static, str>>, prefix: String, extracted: String, ) -> Self
Create a compilation classification for a compound command. The prefix contains everything before the compilation command (including the final “&&” or “;”). The extracted_command is the actual compilation command to intercept.
Trait Implementations§
Source§impl Clone for Classification
impl Clone for Classification
Source§fn clone(&self) -> Classification
fn clone(&self) -> Classification
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 Classification
impl Debug for Classification
Source§impl<'de> Deserialize<'de> for Classification
impl<'de> Deserialize<'de> for Classification
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 JsonSchema for Classification
impl JsonSchema for Classification
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read moreSource§impl PartialEq for Classification
impl PartialEq for Classification
Source§fn eq(&self, other: &Classification) -> bool
fn eq(&self, other: &Classification) -> bool
self and other values to be equal, and is used by ==.