Skip to main content

LockedStore

Struct LockedStore 

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

A GritStore with filesystem-level exclusive lock.

The lock is held for the lifetime of this struct and automatically released when dropped. This prevents multiple processes from opening the same sled database concurrently.

Implementations§

Source§

impl LockedStore

Source

pub fn inner(&self) -> &GritStore

Get a reference to the inner GritStore

Methods from Deref<Target = GritStore>§

Source

pub fn insert_event(&self, event: &Event) -> Result<(), GriteError>

Insert an event and update projections

Source

pub fn get_event(&self, event_id: &EventId) -> Result<Option<Event>, GriteError>

Get an event by ID

Source

pub fn get_issue( &self, issue_id: &IssueId, ) -> Result<Option<IssueProjection>, GriteError>

Get an issue projection by ID

Source

pub fn list_issues( &self, filter: &IssueFilter, ) -> Result<Vec<IssueSummary>, GriteError>

List issues with optional filtering

Source

pub fn get_issue_events( &self, issue_id: &IssueId, ) -> Result<Vec<Event>, GriteError>

Get all events for an issue, sorted by (ts, actor, event_id)

Source

pub fn get_all_events(&self) -> Result<Vec<Event>, GriteError>

Get all events in the store

Source

pub fn rebuild(&self) -> Result<RebuildStats, GriteError>

Rebuild all projections from events

Source

pub fn rebuild_from_events( &self, events: &[Event], ) -> Result<RebuildStats, GriteError>

Rebuild all projections from provided events (for snapshot-based rebuild)

This is useful when rebuilding from a snapshot + WAL combination, where events come from external sources rather than the local store.

Source

pub fn stats(&self, path: &Path) -> Result<DbStats, GriteError>

Get database statistics

Source

pub fn get_dependencies( &self, issue_id: &IssueId, ) -> Result<Vec<(IssueId, DependencyType)>, GriteError>

Get all outgoing dependencies for an issue

Source

pub fn get_dependents( &self, issue_id: &IssueId, ) -> Result<Vec<(IssueId, DependencyType)>, GriteError>

Get all incoming dependencies (what depends on this issue)

Source

pub fn would_create_cycle( &self, source: &IssueId, target: &IssueId, dep_type: &DependencyType, ) -> Result<bool, GriteError>

Check if adding a dependency would create a cycle. Only checks for Blocks/DependsOn (acyclic types).

Source

pub fn topological_order( &self, filter: &IssueFilter, ) -> Result<Vec<IssueSummary>, GriteError>

Get issues in topological order based on dependency relationships. Issues with no dependencies come first.

Source

pub fn get_file_context( &self, path: &str, ) -> Result<Option<FileContext>, GriteError>

Get file context for a specific path

Source

pub fn query_symbols( &self, query: &str, ) -> Result<Vec<(String, String)>, GriteError>

Query symbols by name prefix

Source

pub fn list_context_files(&self) -> Result<Vec<String>, GriteError>

List all indexed file paths

Source

pub fn get_project_context( &self, key: &str, ) -> Result<Option<ProjectContextEntry>, GriteError>

Get a project context entry by key

Source

pub fn list_project_context( &self, ) -> Result<Vec<(String, ProjectContextEntry)>, GriteError>

List all project context entries

Source

pub fn flush(&self) -> Result<(), GriteError>

Flush pending writes to disk

Trait Implementations§

Source§

impl Debug for LockedStore

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Deref for LockedStore

Source§

type Target = GritStore

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl DerefMut for LockedStore

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.

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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V