pub struct FileStorage { /* private fields */ }Expand description
File-based storage implementation for tickets
This implementation stores tickets as YAML files in a directory structure within the project’s .vibe-ticket directory.
Implementations§
Source§impl FileStorage
impl FileStorage
Sourcepub fn ensure_directories(&self) -> Result<()>
pub fn ensure_directories(&self) -> Result<()>
Ensures the storage directories exist
Sourcepub fn save_ticket(&self, ticket: &Ticket) -> Result<()>
pub fn save_ticket(&self, ticket: &Ticket) -> Result<()>
Saves a ticket to storage with file locking for concurrent access protection
Sourcepub fn load_ticket(&self, id: &TicketId) -> Result<Ticket>
pub fn load_ticket(&self, id: &TicketId) -> Result<Ticket>
Loads a ticket from storage by ID with read locking
Sourcepub fn load_all_tickets(&self) -> Result<Vec<Ticket>>
pub fn load_all_tickets(&self) -> Result<Vec<Ticket>>
Loads all tickets from storage
Sourcepub fn delete_ticket(&self, id: &TicketId) -> Result<()>
pub fn delete_ticket(&self, id: &TicketId) -> Result<()>
Deletes a ticket from storage with locking
Sourcepub fn set_active_ticket(&self, id: &TicketId) -> Result<()>
pub fn set_active_ticket(&self, id: &TicketId) -> Result<()>
Sets the active ticket with locking
Sourcepub fn get_active_ticket(&self) -> Result<Option<TicketId>>
pub fn get_active_ticket(&self) -> Result<Option<TicketId>>
Gets the active ticket ID
Sourcepub fn clear_active_ticket(&self) -> Result<()>
pub fn clear_active_ticket(&self) -> Result<()>
Clears the active ticket with locking
Sourcepub fn add_active_ticket(&self, id: &TicketId) -> Result<()>
pub fn add_active_ticket(&self, id: &TicketId) -> Result<()>
Adds a ticket to the list of active tickets
This method adds a ticket ID to the active tickets list stored in
active_tickets.yaml. If the file doesn’t exist, it creates it.
Sourcepub fn remove_active_ticket(&self, id: &TicketId) -> Result<()>
pub fn remove_active_ticket(&self, id: &TicketId) -> Result<()>
Removes a ticket from the list of active tickets
Sourcepub fn get_all_active_tickets(&self) -> Result<Vec<TicketId>>
pub fn get_all_active_tickets(&self) -> Result<Vec<TicketId>>
Gets all active ticket IDs
This method reads from both the new active_tickets.yaml and legacy
active_ticket files for backward compatibility.
Sourcepub fn ticket_exists_with_slug(&self, slug: &str) -> Result<bool>
pub fn ticket_exists_with_slug(&self, slug: &str) -> Result<bool>
Checks if a ticket with the given slug already exists
Source§impl FileStorage
impl FileStorage
Sourcepub fn save_state(&self, state: &ProjectState) -> Result<()>
pub fn save_state(&self, state: &ProjectState) -> Result<()>
Saves the project state
Sourcepub fn load_state(&self) -> Result<ProjectState>
pub fn load_state(&self) -> Result<ProjectState>
Loads the project state