Skip to main content

Source

Struct Source 

Source
pub struct Source {
    pub fetch: Arc<dyn Fn() -> String + Send + Sync>,
    pub ended: Option<Box<dyn Fn() -> String>>,
    pub cur: String,
    pub cur_cwd: String,
    pub cur_target: String,
    pub home: String,
    pub newver: String,
    pub script: Option<String>,
    pub popup: bool,
    pub state: State,
}
Expand description

Where rows come from, and what does not change while the picker is open.

fetch is a closure rather than a string so ctrl-r and the refresh timer can ask again. ended is separate because the ended list is not the pane list filtered: it comes off the sessions cache and nothing in it has a pane at all.

Fields§

§fetch: Arc<dyn Fn() -> String + Send + Sync>

Shared and thread-safe because a refresh runs OFF the input loop: see start_refresh. It was a plain closure until a sweep froze the picker for the 85 seconds its restarts took, with no key accepted and nothing on screen to say why.

§ended: Option<Box<dyn Fn() -> String>>

The ended list stays synchronous: it is a read of one cache file, with no fork in it, and it is what Tab’s last stop shows the instant you land on it. Nothing here has ever been slow, and making it async would mean showing pane rows under the “past sessions” label while it arrived.

§cur: String§cur_cwd: String

Where the pane the picker was opened from IS, for the case where that pane is not an agent session: cur then matches no row at all and these are what the cursor is placed by instead. See nearest.

Empty means “not known”, which is what every entry point but pick hands over, and the cursor then opens at the top of the list as it always did.

§cur_target: String§home: String§newver: String§script: Option<String>

The taimux script, for the two keys that act rather than navigate. Unset means they are not bound, and the header then does not advertise them: the header only ever says what is really there.

§popup: bool

Set only when the binding said so with -e TAIMUX_POPUP=1. It is what allows the picker to close and reopen itself at a new size, which would be wrong for a picker running inline in a pane: tmux resizes a PANE with the client already, so there is nothing to do there and everything to lose by guessing.

§state: State

What a previous instance was doing when the terminal grew under it.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Source

§

impl !Send for Source

§

impl !Sync for Source

§

impl !UnwindSafe for Source

§

impl Freeze for Source

§

impl Unpin for Source

§

impl UnsafeUnpin for Source

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<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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
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.