pub struct SessionHandle {
pub session_id: String,
/* private fields */
}Expand description
Handle for interacting with a single persistent session.
Fields§
§session_id: StringImplementations§
Source§impl SessionHandle
impl SessionHandle
pub fn dir(&self) -> &Path
pub fn base_path(&self) -> PathBuf
pub fn binlog_path(&self) -> PathBuf
pub fn head_path(&self) -> PathBuf
pub fn current_branch_path(&self) -> PathBuf
pub fn branches_path(&self) -> PathBuf
pub fn snapshot_manifest_path(&self) -> PathBuf
pub fn snapshot_file_path(&self, op_id: &str) -> PathBuf
pub fn staged_dir(&self) -> PathBuf
pub fn lock_path(&self) -> PathBuf
Sourcepub fn read_head(&self) -> Result<Option<String>>
pub fn read_head(&self) -> Result<Option<String>>
Read the current HEAD op_id. Returns None if HEAD is empty (at base).
Sourcepub fn write_head(&self, op_id: &str) -> Result<()>
pub fn write_head(&self, op_id: &str) -> Result<()>
Set the HEAD op_id.
Sourcepub fn clear_head(&self) -> Result<()>
pub fn clear_head(&self) -> Result<()>
Clear HEAD back to base state.
Sourcepub fn current_branch(&self) -> Result<String>
pub fn current_branch(&self) -> Result<String>
Read the current branch name.
Sourcepub fn switch_branch(&self, branch_name: &str) -> Result<()>
pub fn switch_branch(&self, branch_name: &str) -> Result<()>
Switch to a different branch.
Sourcepub fn create_branch(
&self,
name: &str,
fork_point: Option<&str>,
label: Option<&str>,
) -> Result<()>
pub fn create_branch( &self, name: &str, fork_point: Option<&str>, label: Option<&str>, ) -> Result<()>
Create a new branch forking from the given op_id.
Sourcepub fn list_branches(&self) -> Result<Vec<BranchInfo>>
pub fn list_branches(&self) -> Result<Vec<BranchInfo>>
List all branches.
Sourcepub fn append_event(&self, event: OpEvent) -> Result<()>
pub fn append_event(&self, event: OpEvent) -> Result<()>
Append an event to the binlog and advance HEAD + branch tip. This is the atomic apply operation.
Sourcepub fn read_events(&self) -> Result<Vec<OpEvent>>
pub fn read_events(&self) -> Result<Vec<OpEvent>>
Read all events in the binlog.
Sourcepub fn read_events_after(&self, after_op_id: &str) -> Result<Vec<OpEvent>>
pub fn read_events_after(&self, after_op_id: &str) -> Result<Vec<OpEvent>>
Read events after a given op_id.
Sourcepub fn materialize(&self) -> Result<Vec<u8>>
pub fn materialize(&self) -> Result<Vec<u8>>
Materialize the workbook at the current HEAD by loading base + replaying events.
Sourcepub fn materialize_at(&self, target_op_id: &str) -> Result<Vec<u8>>
pub fn materialize_at(&self, target_op_id: &str) -> Result<Vec<u8>>
Materialize the workbook at a specific op_id.
Sourcepub fn meta(&self) -> Result<SessionMeta>
pub fn meta(&self) -> Result<SessionMeta>
Read session metadata.
Auto Trait Implementations§
impl Freeze for SessionHandle
impl RefUnwindSafe for SessionHandle
impl Send for SessionHandle
impl Sync for SessionHandle
impl Unpin for SessionHandle
impl UnsafeUnpin for SessionHandle
impl UnwindSafe for SessionHandle
Blanket Implementations§
impl<T> Allocation for T
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more