pub struct ImageIntegration {
pub enabled: bool,
pub max_images_per_prompt: usize,
pub current_images: Vec<PathBuf>,
}Expand description
Image integration manager for ricecoder-tui
Handles:
- Drag-and-drop event detection and forwarding to ricecoder-images
- Image display coordination with ricecoder-images ImageDisplay
- Image context management for prompts
§Requirements
- Req 1.1: Create interface for receiving drag-and-drop events from ricecoder-tui
- Req 1.1: Implement file path extraction from events
- Req 1.1: Handle multiple files in single drag-and-drop
Fields§
§enabled: boolWhether image integration is enabled
max_images_per_prompt: usizeMaximum number of images per prompt
current_images: Vec<PathBuf>Current images in the prompt context
Implementations§
Source§impl ImageIntegration
impl ImageIntegration
Sourcepub fn handle_drag_drop_event(
&mut self,
paths: Vec<PathBuf>,
) -> (Vec<PathBuf>, Vec<String>)
pub fn handle_drag_drop_event( &mut self, paths: Vec<PathBuf>, ) -> (Vec<PathBuf>, Vec<String>)
Sourcepub fn remove_image(&mut self, path: &PathBuf) -> bool
pub fn remove_image(&mut self, path: &PathBuf) -> bool
Sourcepub fn clear_images(&mut self)
pub fn clear_images(&mut self)
Clear all images from the prompt context
Sourcepub fn get_images(&self) -> &[PathBuf]
pub fn get_images(&self) -> &[PathBuf]
Get the current images in the prompt context
Sourcepub fn has_images(&self) -> bool
pub fn has_images(&self) -> bool
Check if there are any images in the prompt context
Sourcepub fn image_count(&self) -> usize
pub fn image_count(&self) -> usize
Get the number of images in the prompt context
Sourcepub fn set_max_images(&mut self, max: usize)
pub fn set_max_images(&mut self, max: usize)
Set the maximum number of images per prompt
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ImageIntegration
impl RefUnwindSafe for ImageIntegration
impl Send for ImageIntegration
impl Sync for ImageIntegration
impl Unpin for ImageIntegration
impl UnwindSafe for ImageIntegration
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more