Skip to main content

select_thread_base

Function select_thread_base 

Source
pub fn select_thread_base(
    requested_from: Option<StateId>,
    existing_tip: Option<StateId>,
) -> Result<ThreadBaseSelection, ThreadBaseError>
Expand description

Select the base state for a new or resumed thread start.

Rules (matching CLI start_thread):

  1. Existing tip + matching --from (or no --from) → use existing tip
  2. Existing tip + mismatched --fromThreadBaseError::AnchorMismatch
  3. No existing tip + --from → use the resolved --from
  4. Neither → ThreadBaseSelection::RequireCurrent