pub struct Completion {
pub values: Vec<CompletionValue>,
pub total: Option<u32>,
pub has_more: Option<bool>,
pub next_cursor: Option<String>,
}Expand description
Completion result set
Fields§
§values: Vec<CompletionValue>Completion values
total: Option<u32>Total number of possible completions (for pagination)
has_more: Option<bool>Whether there are more completions available
next_cursor: Option<String>Next cursor for pagination
Implementations§
Source§impl Completion
impl Completion
Sourcepub fn new(values: Vec<CompletionValue>) -> Completion
pub fn new(values: Vec<CompletionValue>) -> Completion
Create a new completion set
Sourcepub fn with_metadata(
values: Vec<CompletionValue>,
total: u32,
has_more: bool,
) -> Completion
pub fn with_metadata( values: Vec<CompletionValue>, total: u32, has_more: bool, ) -> Completion
Create with metadata
Sourcepub fn with_pagination(
values: Vec<CompletionValue>,
total: u32,
has_more: bool,
next_cursor: String,
) -> Completion
pub fn with_pagination( values: Vec<CompletionValue>, total: u32, has_more: bool, next_cursor: String, ) -> Completion
Create with pagination
Sourcepub fn sort_by_priority(&mut self)
pub fn sort_by_priority(&mut self)
Sort completions by priority
Sourcepub fn filter_by_prefix(&self, prefix: &str) -> Completion
pub fn filter_by_prefix(&self, prefix: &str) -> Completion
Filter completions by prefix
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 · 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<'de> Deserialize<'de> for Completion
impl<'de> Deserialize<'de> for Completion
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Completion, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Completion, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for Completion
impl Serialize for Completion
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for Completion
impl RefUnwindSafe for Completion
impl Send for Completion
impl Sync for Completion
impl Unpin 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