pub struct StoreWriter { /* private fields */ }Expand description
Appends events, prompts and ingest cursors to the store.
Implementations§
Source§impl StoreWriter
impl StoreWriter
Sourcepub fn open(paths: StorePaths) -> Result<Self>
pub fn open(paths: StorePaths) -> Result<Self>
Open the store at paths, creating ~/.warden/ and its subdirectories
0700 if missing.
pub fn paths(&self) -> &StorePaths
Sourcepub fn append_event(&mut self, event: &Event) -> Result<Partition>
pub fn append_event(&mut self, event: &Event) -> Result<Partition>
Append one event to events/YYYY-MM.jsonl, chosen by its UTC month.
Sourcepub fn append_prompt(
&mut self,
ts_ms: i64,
prompt: &PromptRecord,
) -> Result<Partition>
pub fn append_prompt( &mut self, ts_ms: i64, prompt: &PromptRecord, ) -> Result<Partition>
Append prompt text to the partition matching its event’s timestamp.
Sourcepub fn append_cursor(&mut self, cursor: &IngestCursor) -> Result<()>
pub fn append_cursor(&mut self, cursor: &IngestCursor) -> Result<()>
Append an ingest cursor to state/ingest.jsonl.
Auto Trait Implementations§
impl Freeze for StoreWriter
impl RefUnwindSafe for StoreWriter
impl Send for StoreWriter
impl Sync for StoreWriter
impl Unpin for StoreWriter
impl UnsafeUnpin for StoreWriter
impl UnwindSafe for StoreWriter
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