pub struct SessionMetadataService;Implementations§
Source§impl SessionMetadataService
impl SessionMetadataService
Sourcepub async fn set_title(
state: &AppState,
session_id: &str,
new_title: &str,
) -> Result<MetadataChange<(String, u64)>, MetadataError>
pub async fn set_title( state: &AppState, session_id: &str, new_title: &str, ) -> Result<MetadataChange<(String, u64)>, MetadataError>
Manual rename via PATCH. Always authoritative; always bumps
title_version and metadata_version. Returns Ok(None) when the
trimmed input equals the existing title (no event emitted).
Sourcepub async fn apply_generated_title(
state: &AppState,
session_id: &str,
candidate: &str,
source: TitleSource,
force: bool,
) -> Result<MetadataChange<(String, u64)>, MetadataError>
pub async fn apply_generated_title( state: &AppState, session_id: &str, candidate: &str, source: TitleSource, force: bool, ) -> Result<MetadataChange<(String, u64)>, MetadataError>
Auto/fallback rename produced by the title generator. Aborts (returns
Ok(None)) if the on-disk session is no longer untitled and force
is false — this guards against races where the user renames mid-LLM.
On success bumps title_version and metadata_version, emits with
the supplied TitleSource.
Sourcepub async fn set_pinned(
state: &AppState,
session_id: &str,
pinned: bool,
) -> Result<MetadataChange<bool>, MetadataError>
pub async fn set_pinned( state: &AppState, session_id: &str, pinned: bool, ) -> Result<MetadataChange<bool>, MetadataError>
Toggle the pinned flag. Returns Ok(None) if the requested value
matches the current state (no event emitted). Bumps metadata_version.
Auto Trait Implementations§
impl Freeze for SessionMetadataService
impl RefUnwindSafe for SessionMetadataService
impl Send for SessionMetadataService
impl Sync for SessionMetadataService
impl Unpin for SessionMetadataService
impl UnsafeUnpin for SessionMetadataService
impl UnwindSafe for SessionMetadataService
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