pub struct CompletionContext {
pub completion_id: String,
pub completion_ref: CompletionReference,
pub argument_name: Option<String>,
pub partial_value: Option<String>,
pub resolved_arguments: HashMap<String, String>,
pub completions: Vec<CompletionOption>,
pub cursor_position: Option<usize>,
pub max_completions: Option<usize>,
pub has_more: bool,
pub total_completions: Option<usize>,
pub client_capabilities: Option<CompletionCapabilities>,
pub metadata: HashMap<String, Value>,
}
Expand description
Context for completion/autocompletion requests
Fields§
§completion_id: String
Unique completion request ID
completion_ref: CompletionReference
Reference being completed (prompt, resource template, etc.)
argument_name: Option<String>
Current argument being completed
partial_value: Option<String>
Partial value being completed
resolved_arguments: HashMap<String, String>
Previously resolved arguments
completions: Vec<CompletionOption>
Available completion options
cursor_position: Option<usize>
Cursor position for completion
max_completions: Option<usize>
Maximum number of completions to return
has_more: bool
Whether more completions are available
total_completions: Option<usize>
Total number of available completions
client_capabilities: Option<CompletionCapabilities>
Client capabilities for completion
metadata: HashMap<String, Value>
Completion metadata
Implementations§
Source§impl CompletionContext
impl CompletionContext
Sourcepub fn new(completion_ref: CompletionReference) -> Self
pub fn new(completion_ref: CompletionReference) -> Self
Create a new completion context
Sourcepub fn add_completion(&mut self, option: CompletionOption)
pub fn add_completion(&mut self, option: CompletionOption)
Add a completion option
Sourcepub fn with_resolved_arguments(self, args: HashMap<String, String>) -> Self
pub fn with_resolved_arguments(self, args: HashMap<String, String>) -> Self
Set resolved arguments
Trait Implementations§
Source§impl Clone for CompletionContext
impl Clone for CompletionContext
Source§fn clone(&self) -> CompletionContext
fn clone(&self) -> CompletionContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for CompletionContext
impl Debug for CompletionContext
Source§impl<'de> Deserialize<'de> for CompletionContext
impl<'de> Deserialize<'de> for CompletionContext
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for CompletionContext
impl RefUnwindSafe for CompletionContext
impl Send for CompletionContext
impl Sync for CompletionContext
impl Unpin for CompletionContext
impl UnwindSafe for CompletionContext
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
Mutably borrows from an owned value. Read more