pub struct RemoteFiles {
pub conn: String,
pub home: String,
pub os: String,
calls: UnboundedSender<Call>,
last_used: Mutex<Instant>,
}Expand description
One open connection to a host’s helper.
Fields§
§conn: StringThe connection’s canonical name.
home: StringThe user’s home directory there (~).
os: Stringstd::env::consts::OS there.
calls: UnboundedSender<Call>§last_used: Mutex<Instant>Implementations§
Source§impl RemoteFiles
impl RemoteFiles
Sourcepub async fn over<R, W>(
conn: &str,
reader: R,
writer: W,
keep: Box<dyn Any + Send>,
) -> Result<Arc<Self>, RemoteError>
pub async fn over<R, W>( conn: &str, reader: R, writer: W, keep: Box<dyn Any + Send>, ) -> Result<Arc<Self>, RemoteError>
Speak the protocol over reader and writer (an ssh’s stdout and
stdin), handshake included. keep lives as long as the connection
(the ssh child and its askpass grant).
Sourcepub async fn call(&self, req: Request) -> Result<Reply, RemoteError>
pub async fn call(&self, req: Request) -> Result<Reply, RemoteError>
One request; a host’s refusal is Err with its kind.
pub async fn stat(&self, path: &str) -> Result<Entry, RemoteError>
Sourcepub async fn list(&self, path: &str) -> Result<Vec<Entry>, RemoteError>
pub async fn list(&self, path: &str) -> Result<Vec<Entry>, RemoteError>
Every entry of a directory, a page at a time.
Sourcepub async fn read(&self, path: &str, max: u64) -> Result<Vec<u8>, RemoteError>
pub async fn read(&self, path: &str, max: u64) -> Result<Vec<u8>, RemoteError>
A whole file of at most max bytes, read in ranges.
Sourcepub async fn write(&self, path: &str, data: Vec<u8>) -> Result<(), RemoteError>
pub async fn write(&self, path: &str, data: Vec<u8>) -> Result<(), RemoteError>
Replace a file with data, atomically on the host.
Sourcepub async fn append(&self, path: &str, data: Vec<u8>) -> Result<(), RemoteError>
pub async fn append(&self, path: &str, data: Vec<u8>) -> Result<(), RemoteError>
Add data to the end of an existing file (a big upload, in pieces).
Sourcepub async fn read_range(
&self,
path: &str,
offset: u64,
len: u32,
) -> Result<(Vec<u8>, bool), RemoteError>
pub async fn read_range( &self, path: &str, offset: u64, len: u32, ) -> Result<(Vec<u8>, bool), RemoteError>
One range of a file: up to len bytes from offset, and whether the
file ends there.
Sourcepub async fn replace(&self, from: &str, to: &str) -> Result<(), RemoteError>
pub async fn replace(&self, from: &str, to: &str) -> Result<(), RemoteError>
Rename the file from over the file to in one step.
Sourcepub async fn realpath(&self, path: &str) -> Result<String, RemoteError>
pub async fn realpath(&self, path: &str) -> Result<String, RemoteError>
path with its links and .. resolved.
Sourcepub async fn set_meta(
&self,
path: &str,
mode: u32,
mtime_ms: i64,
) -> Result<(), RemoteError>
pub async fn set_meta( &self, path: &str, mode: u32, mtime_ms: i64, ) -> Result<(), RemoteError>
A file’s permission bits (mode, 0 to leave) and modification time
(mtime_ms, 0 to leave).
Sourcepub async fn sync(&self, path: &str) -> Result<(), RemoteError>
pub async fn sync(&self, path: &str) -> Result<(), RemoteError>
Flush a file’s contents to disk.
Sourcepub async fn pane_procs(
&self,
block_id: &str,
session: &str,
) -> Result<PaneFrame, RemoteError>
pub async fn pane_procs( &self, block_id: &str, session: &str, ) -> Result<PaneFrame, RemoteError>
One pane’s processes on the host (PaneProcs): durable session’s
shell, else those marked with block_id.
Sourcepub async fn procs(
&self,
top: u32,
filter: &str,
) -> Result<ProcFrame, RemoteError>
pub async fn procs( &self, top: u32, filter: &str, ) -> Result<ProcFrame, RemoteError>
The host’s processes for Tower: the top busiest and largest among
those matching filter, with totals (agentmux_remote::procs).
pub async fn mkdir(&self, path: &str, parents: bool) -> Result<(), RemoteError>
pub async fn rename(&self, from: &str, to: &str) -> Result<(), RemoteError>
pub async fn delete( &self, path: &str, recursive: bool, ) -> Result<(), RemoteError>
async fn done(&self, req: Request) -> Result<(), RemoteError>
fn idle_for(&self) -> Duration
Auto Trait Implementations§
impl !Freeze for RemoteFiles
impl RefUnwindSafe for RemoteFiles
impl Send for RemoteFiles
impl Sync for RemoteFiles
impl Unpin for RemoteFiles
impl UnsafeUnpin for RemoteFiles
impl UnwindSafe for RemoteFiles
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