pub struct MessageContentSignal {
pub message_length: usize,
pub line_count: usize,
pub has_code_blocks: bool,
pub file_path_count: usize,
pub symbol_density: f64,
pub is_question: bool,
pub is_single_sentence: bool,
}Expand description
Signal derived from the structural properties of the last user message.
Language-agnostic — measures length, line count, code blocks, file paths, symbol density, etc. No keyword matching.
Fields§
§message_length: usizeCharacter count of the last user message.
line_count: usizeNumber of lines.
has_code_blocks: boolWhether the message contains code fences ( ).
file_path_count: usizeNumber of distinct file path references detected.
symbol_density: f64Ratio of code-like symbols to total characters.
is_question: boolWhether the message ends with ‘?’.
is_single_sentence: boolWhether it’s a short single-sentence (≤3 words, no newlines).
Implementations§
Source§impl MessageContentSignal
impl MessageContentSignal
Sourcepub fn extract(messages: &[Message]) -> MessageContentSignal
pub fn extract(messages: &[Message]) -> MessageContentSignal
Extract from the last user message in the conversation.
Sourcepub fn from_text(text: &str) -> MessageContentSignal
pub fn from_text(text: &str) -> MessageContentSignal
Analyze a raw text string.
Sourcepub fn normalized(&self) -> f64
pub fn normalized(&self) -> f64
Normalize to [0, 1] for scoring.
Contributions:
- length: 0–0.25
- line count: 0–0.15
- code blocks: 0 or 0.15
- file paths: 0–0.15
- symbol density: 0–0.15
- down-weight: question/short → −0.08/−0.06
Sourcepub fn decisive_tier(&self) -> Option<RouterTier>
pub fn decisive_tier(&self) -> Option<RouterTier>
Quick override: returns Some(tier) if the signal is decisive enough
to skip the full scoring pipeline.
Used by Layer 0 (“확실한가?”) — only triggers when the signal is overwhelmingly simple or complex.
Trait Implementations§
Source§impl Clone for MessageContentSignal
impl Clone for MessageContentSignal
Source§fn clone(&self) -> MessageContentSignal
fn clone(&self) -> MessageContentSignal
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 MessageContentSignal
impl Debug for MessageContentSignal
Source§impl Default for MessageContentSignal
impl Default for MessageContentSignal
Source§fn default() -> MessageContentSignal
fn default() -> MessageContentSignal
Auto Trait Implementations§
impl Freeze for MessageContentSignal
impl RefUnwindSafe for MessageContentSignal
impl Send for MessageContentSignal
impl Sync for MessageContentSignal
impl Unpin for MessageContentSignal
impl UnsafeUnpin for MessageContentSignal
impl UnwindSafe for MessageContentSignal
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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.