pub struct GeminiProjector {
pub project_hash: Option<String>,
pub project_path: Option<String>,
}Expand description
Project a ConversationView into a Gemini Conversation.
Config fields are optional — pass them when you want to populate
file-level metadata that doesn’t live on ConversationView (the
project hash and absolute project path). None-valued fields fall
through to empty strings / defaults, which Gemini CLI accepts.
§Example
use toolpath_gemini::project::GeminiProjector;
use toolpath_convo::{ConversationProjector, ConversationView};
let view = ConversationView {
id: "session-uuid".into(),
started_at: None,
last_activity: None,
turns: vec![],
total_usage: None,
provider_id: Some("gemini-cli".into()),
files_changed: vec![],
session_ids: vec![],
events: vec![],
};
let projector = GeminiProjector::default();
let convo = projector.project(&view).unwrap();
assert_eq!(convo.session_uuid, "session-uuid");Fields§
§project_hash: Option<String>SHA-256 hex of the absolute project path. Round-trip callers
should preserve the original value; new sessions can leave it None.
project_path: Option<String>Absolute project path for Conversation::project_path.
Implementations§
Source§impl GeminiProjector
impl GeminiProjector
pub fn new() -> Self
pub fn with_project_hash(self, hash: impl Into<String>) -> Self
pub fn with_project_path(self, path: impl Into<String>) -> Self
Trait Implementations§
Source§impl Clone for GeminiProjector
impl Clone for GeminiProjector
Source§fn clone(&self) -> GeminiProjector
fn clone(&self) -> GeminiProjector
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 ConversationProjector for GeminiProjector
impl ConversationProjector for GeminiProjector
Source§type Output = Conversation
type Output = Conversation
The type produced by projecting a
ConversationView.Source§fn project(&self, view: &ConversationView) -> Result<Conversation>
fn project(&self, view: &ConversationView) -> Result<Conversation>
Project
view into Self::Output.Source§impl Debug for GeminiProjector
impl Debug for GeminiProjector
Source§impl Default for GeminiProjector
impl Default for GeminiProjector
Source§fn default() -> GeminiProjector
fn default() -> GeminiProjector
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for GeminiProjector
impl RefUnwindSafe for GeminiProjector
impl Send for GeminiProjector
impl Sync for GeminiProjector
impl Unpin for GeminiProjector
impl UnsafeUnpin for GeminiProjector
impl UnwindSafe for GeminiProjector
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