pub struct PromptCollection {
pub prompts: Vec<Prompt>,
}Expand description
Collection of prompts with metadata
Fields§
§prompts: Vec<Prompt>Implementations§
Source§impl PromptCollection
impl PromptCollection
Sourcepub fn add_prompt(&mut self, prompt: Prompt)
pub fn add_prompt(&mut self, prompt: Prompt)
Add a new prompt to the collection
Sourcepub fn delete_prompt(&mut self, identifier: &str) -> Option<Prompt>
pub fn delete_prompt(&mut self, identifier: &str) -> Option<Prompt>
Delete a prompt by ID or description (smart delete)
Sourcepub fn find_by_id(&self, id: &str) -> Option<&Prompt>
pub fn find_by_id(&self, id: &str) -> Option<&Prompt>
Find a prompt by ID
Sourcepub fn find_by_description(&self, description: &str) -> Option<&Prompt>
pub fn find_by_description(&self, description: &str) -> Option<&Prompt>
Find a prompt by description
Sourcepub fn find_prompt(&self, identifier: &str) -> Option<&Prompt>
pub fn find_prompt(&self, identifier: &str) -> Option<&Prompt>
Find a prompt by ID or description
Sourcepub fn search(
&self,
query: Option<&str>,
tag: Option<&str>,
config: &Config,
) -> Vec<Prompt>
pub fn search( &self, query: Option<&str>, tag: Option<&str>, config: &Config, ) -> Vec<Prompt>
Search prompts with query and tag filtering
Get all unique tags from the collection
Sourcepub fn get_categories(&self) -> Vec<String>
pub fn get_categories(&self) -> Vec<String>
Get all unique categories from the collection
Sourcepub fn get_stats(&self) -> PromptStats
pub fn get_stats(&self) -> PromptStats
Calculate statistics for the collection
Trait Implementations§
Source§impl Clone for PromptCollection
impl Clone for PromptCollection
Source§fn clone(&self) -> PromptCollection
fn clone(&self) -> PromptCollection
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 PromptCollection
impl Debug for PromptCollection
Source§impl Default for PromptCollection
impl Default for PromptCollection
Source§impl<'de> Deserialize<'de> for PromptCollection
impl<'de> Deserialize<'de> for PromptCollection
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 PromptCollection
impl RefUnwindSafe for PromptCollection
impl Send for PromptCollection
impl Sync for PromptCollection
impl Unpin for PromptCollection
impl UnwindSafe for PromptCollection
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