#[non_exhaustive]pub struct Completion {
pub values: Vec<String>,
pub total: Option<u32>,
pub has_more: Option<bool>,
}Expand description
Suggested values for one argument.
The host truncates Self::values to the limit MCP places on a single
completion response and marks the result as having more, so a plugin may
return everything it knows without tracking the protocol’s cap.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.values: Vec<String>Suggestions, best first.
total: Option<u32>How many exist in total, when the plugin knows and it exceeds what it returned.
has_more: Option<bool>Whether more exist beyond Self::values.
Leave unset unless the plugin itself truncated; the host sets it when its own truncation drops values.
Implementations§
Source§impl Completion
impl Completion
Sourcepub fn new(values: impl IntoIterator<Item = String>) -> Self
pub fn new(values: impl IntoIterator<Item = String>) -> Self
Suggest values, best first.
Sourcepub fn with_total(self, total: u32) -> Self
pub fn with_total(self, total: u32) -> Self
Report how many suggestions exist in total.
Sourcepub fn with_has_more(self, has_more: bool) -> Self
pub fn with_has_more(self, has_more: bool) -> Self
Report that the plugin itself returned only part of what it knows.
Trait Implementations§
Source§impl Clone for Completion
impl Clone for Completion
Source§fn clone(&self) -> Completion
fn clone(&self) -> Completion
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 Completion
impl Debug for Completion
Source§impl Default for Completion
impl Default for Completion
Source§fn default() -> Completion
fn default() -> Completion
Returns the “default value” for a type. Read more
impl Eq for Completion
Source§impl PartialEq for Completion
impl PartialEq for Completion
impl StructuralPartialEq for Completion
Auto Trait Implementations§
impl Freeze for Completion
impl RefUnwindSafe for Completion
impl Send for Completion
impl Sync for Completion
impl Unpin for Completion
impl UnsafeUnpin for Completion
impl UnwindSafe for Completion
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.