Skip to main content

CursorIO

Struct CursorIO 

Source
pub struct CursorIO { /* private fields */ }
Expand description

The facade most consumers want. Wraps a PathResolver and lazily opens the SQLite database on demand.

Implementations§

Source§

impl CursorIO

Source

pub fn new() -> Self

Source

pub fn with_resolver(resolver: PathResolver) -> Self

Source

pub fn resolver(&self) -> &PathResolver

Source

pub fn exists(&self) -> bool

Source

pub fn db_path(&self) -> Result<PathBuf>

Source

pub fn read_composer_headers(&self) -> Result<ComposerHeaders>

Read composer.composerHeaders verbatim.

Source

pub fn list_composer_ids(&self) -> Result<Vec<String>>

All composer ids known to the database, including drafts. Use Self::list_composers when you only want sessions that have at least one bubble on disk.

Source

pub fn list_composers(&self) -> Result<Vec<ComposerListing>>

Composer headers paired to whether they have any rendered bubbles. Empty drafts (has_bubbles == false) are commonly dropped by callers that want a session list.

Source

pub fn list_session_metadata(&self) -> Result<Vec<CursorSessionMetadata>>

Lightweight per-composer metadata for every composer that has at least one bubble on disk.

Source

pub fn read_session_metadata( &self, composer_id: &str, ) -> Result<CursorSessionMetadata>

Lightweight metadata for one composer.

Source

pub fn composer_exists(&self, composer_id: &str) -> Result<bool>

Whether the composer exists in the database (either as a header or as bubble rows).

Source

pub fn read_session(&self, composer_id: &str) -> Result<CursorSession>

Load one session fully (composer data + bubbles + referenced content blobs) and attach the JSONL transcript path when the composer’s workspace folder maps cleanly into ~/.cursor/projects/<slug>/agent-transcripts/<id>/<id>.jsonl.

Source

pub fn locate_transcript(&self, session: &CursorSession) -> Option<PathBuf>

Resolve the JSONL transcript path for a session, if the file exists on disk. Cursor only emits a transcript for agent-mode runs against a real on-disk workspace.

Trait Implementations§

Source§

impl Default for CursorIO

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.