pub struct ForkEngine;Expand description
Forks a session at a given seq, producing a new, fully self-contained child session.
Implementations§
Source§impl ForkEngine
impl ForkEngine
Sourcepub async fn fork(
data_dir: &Path,
src_id: &str,
new_id: &str,
at_seq: Option<u64>,
store: &SessionStore,
owner: Option<&str>,
) -> Result<ForkResult, SessionError>
pub async fn fork( data_dir: &Path, src_id: &str, new_id: &str, at_seq: Option<u64>, store: &SessionStore, owner: Option<&str>, ) -> Result<ForkResult, SessionError>
Fork src_id at at_seq into a caller-allocated new_id (at_seq is an exclusive upper
bound — matches ReplayEngine::replay’s up_to semantics: the child receives events
[0, at_seq) from the parent, plus a synthetic SessionStarted header recording
forked_from). at_seq = None forks at the current end of the log (copies everything) —
the default for callers with no explicit cut point (ACP’s fork_session, which has no
seq parameter, and the CLI’s optional --at).
new_id is caller-supplied rather than minted internally: callers such as ACP’s
do_fork_session need the id before the fork call completes (to construct the session’s
LoopbackChannel/entry), and the CLI mints a fresh SessionId::generate() before calling
in.
owner stamps the child row’s owner_key (#5868) — see SessionStore::record_fork.
§Errors
Returns SessionError::NotFound if src_id has no session-store row,
SessionError::InvalidForkPoint if at_seq exceeds the parent log’s event count, or
SessionError::Io/SessionError::Db if the copy or store update fails.
Auto Trait Implementations§
impl Freeze for ForkEngine
impl RefUnwindSafe for ForkEngine
impl Send for ForkEngine
impl Sync for ForkEngine
impl Unpin for ForkEngine
impl UnsafeUnpin for ForkEngine
impl UnwindSafe for ForkEngine
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
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> ⓘ
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> ⓘ
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