Skip to main content

SessionRequest

Struct SessionRequest 

Source
pub struct SessionRequest {
    pub repo: String,
    pub branch: Option<String>,
    pub branch_name: Option<String>,
    pub branch_prefix: Option<String>,
    pub base: Option<String>,
    pub execution_checkout: Option<String>,
    pub pool: Option<u32>,
    pub overflow: Option<Bound>,
    pub labels: BTreeMap<String, String>,
}
Expand description

What to open a session over.

Fields§

§repo: String

The repository: an identity key, a registered alias, or a path.

§branch: Option<String>

The branch to work on.

A name that already exists — in a checkout of this identity, or on origin — is continued: the session’s worktree is opened at that branch’s tip and carries the work already on it. A name nothing carries yet is cut fresh from base. Absent means one is derived, which is always a fresh cut.

§branch_name: Option<String>

A name the caller wants a branch cut at, which is a different question from branch.

branch names a branch to continue — anything already carrying that name is opened at its tip — so a rendered name cannot arrive there: a collision would silently continue somebody else’s branch. This one is a proposal, and this crate does all of the work of turning it into a branch: it is sanitized into a name git accepts, the host’s branch prefix is put in front of it, and the first free of <name>, <name>-2, <name>-3, … is taken — searched against this identity’s local branches and its origin’s. A proposal nothing usable is left of, and one no suffix can make free, are refused naming the proposal rather than silently replaced by a derived name.

Absent means a name is derived from the session’s own token, exactly as before. Naming this and branch is refused: they are two answers to one question.

§branch_prefix: Option<String>

The branch prefix this one open cuts against, over everything the host configures — the highest of the three layers branches resolves. Absent means the host’s resolution; Some("") is this open saying it wants none.

It reaches only branches this open cuts: a branch named by branch is continued or cut at exactly that name, prefixed by nothing.

§base: Option<String>

The branch this session’s work is merged with and published into.

For a branch cut fresh it is also the point the branch starts from. For a branch that already exists it is the integration target and nothing else: what is merged in when it has moved on, and what the publication is compared against. Absent means the identity’s registered base. Naming the session’s own branch here is refused — it would publish the branch into itself.

§execution_checkout: Option<String>

Which registered checkout to clone from. Absent means the identity’s default execution checkout.

§pool: Option<u32>

The pool size this one open places against, over everything the host configures: 0 places this session fresh under runs/ — and still spends the overflow, because the cap is about disk — and N may cut a slot while fewer than N exist. It removes no slot. Absent means the host’s resolution.

§overflow: Option<Bound>

The overflow bound this one open is admitted against, over everything the host configures; Bound::Unlimited is how one open opts out of the cap. Absent means the host’s resolution.

§labels: BTreeMap<String, String>

What the caller wants the session record to say about who opened it: the run, the node, the launching process — whatever it takes to find this session again without joining anything else. A key is [A-Za-z0-9_-]+ and a value is one line; what a key means is the caller’s to declare. Stored on the record, reported by session holders and on every recoverable row, and what --label filters both by. A resumed session takes each key the request names over the one it had and keeps the rest.

Trait Implementations§

Source§

impl Clone for SessionRequest

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SessionRequest

Source§

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

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

impl<'de> Deserialize<'de> for SessionRequest

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for SessionRequest

Source§

impl PartialEq for SessionRequest

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for SessionRequest

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for SessionRequest

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.