struct Run {
block_id: String,
conn: String,
host: HostSsh,
session: String,
size: (u16, u16),
broker: Option<Arc<Broker>>,
filestore: Option<Arc<FileStore>>,
_askpass_grant: Option<Revoke>,
plain: Arc<AtomicBool>,
by_default: bool,
}Expand description
One durable pane’s connection loop.
Fields§
§block_id: String§conn: String§host: HostSshThe host, with askpass for ssh’s prompts.
session: String§size: (u16, u16)§broker: Option<Arc<Broker>>§filestore: Option<Arc<FileStore>>§_askpass_grant: Option<Revoke>The askpass grant behind host’s prompts (revoked on drop).
plain: Arc<AtomicBool>Set when the run ends because the helper isn’t to be had (the user declined it, or durable was only the default and it didn’t install): the pane becomes a plain SSH terminal.
by_default: boolDurable only by default (Mode::Default): without the helper the
pane becomes a plain terminal rather than stopping.
Implementations§
Source§impl Run
impl Run
Sourceasync fn run(
self,
input_rx: UnboundedReceiver<Frame>,
leave_rx: Receiver<Leave>,
stopped: Box<dyn FnOnce(Done) + Send>,
) -> Option<Done>
async fn run( self, input_rx: UnboundedReceiver<Frame>, leave_rx: Receiver<Leave>, stopped: Box<dyn FnOnce(Done) + Send>, ) -> Option<Done>
Connect, and reconnect for as long as the pane wants the session.
Some when the session (or the attempt to reach it) is over and the
pane should show it done; None when the pane left. A refused login
shows the pane done through stopped and stays until the pane leaves
(see there).
Sourceasync fn wait_for_user(
&mut self,
line: &str,
leave_rx: &mut Receiver<Leave>,
stopped: Box<dyn FnOnce(Done) + Send>,
) -> Option<Done>
async fn wait_for_user( &mut self, line: &str, leave_rx: &mut Receiver<Leave>, stopped: Box<dyn FnOnce(Done) + Send>, ) -> Option<Done>
Say line, show the pane done without ending the session (a restart
reattaches to it), and stay until the pane leaves: closing it still
ends the session (one end, best effort, any prompt to the user), as
for any durable pane. A restart replaces this run: its leave sender
goes, and this returns.
Sourceasync fn attach_once(
&mut self,
input_rx: &mut UnboundedReceiver<Frame>,
leave_rx: &mut Receiver<Leave>,
reconnecting: bool,
) -> Ended
async fn attach_once( &mut self, input_rx: &mut UnboundedReceiver<Frame>, leave_rx: &mut Receiver<Leave>, reconnecting: bool, ) -> Ended
One ssh to the session, until it drops or the pane leaves.
reconnecting: the pane said it lost the session, so it says when it
has it again.
Sourceasync fn end_remote(&self)
async fn end_remote(&self)
End the session on the host with one short ssh (agentmux-remote end): a pane closed while disconnected must not leave its shell
running there with nothing able to reach it. Best effort, bounded.
Sourceasync fn host_is_windows(&self) -> Option<bool>
async fn host_is_windows(&self) -> Option<bool>
Whether the host is Windows, asked in a way no language changes: from
cmd or PowerShell, cmd /c echo %OS% prints Windows_NT; a POSIX
host has no cmd. None when there was no answer from the host
(ssh failed or timed out), so it can be asked again.
fn ssh_command(&self, remote: &str) -> Command
Sourceasync fn install_helper(&self) -> Result<(), String>
async fn install_helper(&self) -> Result<(), String>
Put this version’s helper on the host (helper_install::ensure),
saying so in the pane, once the user has said yes
(helper_consent). Err says why not.
fn read_offset(&self) -> u64
fn write_offset(&self, offset: u64)
Sourceasync fn append(&self, data: Vec<u8>) -> bool
async fn append(&self, data: Vec<u8>) -> bool
Append to the pane’s terminal, exactly as a PTY’s output is appended.
Sourceasync fn note_owned(&self, text: String)
async fn note_owned(&self, text: String)
Self::note with an owned line (for a closure’s future).
Auto Trait Implementations§
impl !RefUnwindSafe for Run
impl !UnwindSafe for Run
impl Freeze for Run
impl Send for Run
impl Sync for Run
impl Unpin for Run
impl UnsafeUnpin for Run
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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