AskMode

Struct AskMode 

Source
pub struct AskMode { /* private fields */ }
Expand description

Ask Mode for question answering and explanations

Ask Mode provides capabilities for:

  • Question answering
  • Explanations and guidance
  • Code examples in responses
  • No file modifications or command execution

Implementations§

Source§

impl AskMode

Source

pub fn new() -> Self

Create a new Ask Mode instance

Source

pub fn with_config(config: ModeConfig) -> Self

Create an Ask Mode with custom configuration

Source

pub fn answer_question(&self, question: &str) -> Result<String>

Answer a question clearly

This method generates a clear answer to the provided question.

Source

pub fn explain_concept(&self, concept: &str) -> Result<String>

Provide an explanation for a concept

This method generates an explanation for the given concept.

Source

pub fn include_code_examples( &self, response: &str, language: &str, ) -> Result<String>

Include code examples in a response

This method adds code examples to a response.

Source

pub fn suggest_approach(&self, problem: &str) -> Result<String>

Suggest an approach without executing it

This method provides guidance on how to approach a problem.

Source

pub fn validate_operation(&self, operation: &Operation) -> Result<()>

Validate that an operation is allowed in Ask Mode

This method checks if an operation can be executed in Ask Mode. Only question answering operations are allowed.

Source

pub fn blocked_operation_message(&self, operation: &Operation) -> String

Provide clear error message for blocked operations

This method generates a user-friendly error message for blocked operations.

Trait Implementations§

Source§

impl Clone for AskMode

Source§

fn clone(&self) -> AskMode

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AskMode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for AskMode

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Mode for AskMode

Source§

fn id(&self) -> &str

Mode identifier (e.g., “code”, “ask”, “vibe”)
Source§

fn name(&self) -> &str

Human-readable name
Source§

fn description(&self) -> &str

Mode description
Source§

fn system_prompt(&self) -> &str

Get system prompt for this mode
Source§

fn process<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, input: &'life1 str, context: &'life2 ModeContext, ) -> Pin<Box<dyn Future<Output = Result<ModeResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Process user input in this mode
Source§

fn capabilities(&self) -> Vec<Capability>

Get mode-specific capabilities
Source§

fn config(&self) -> &ModeConfig

Get mode configuration
Source§

fn can_execute(&self, operation: &Operation) -> bool

Validate if operation is allowed in this mode
Source§

fn constraints(&self) -> ModeConstraints

Get mode-specific constraints

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.