pub struct SftpFs { /* private fields */ }Implementations§
Source§impl SftpFs
impl SftpFs
pub async fn connect(host: &str) -> Result<Self>
Sourcepub fn is_alive(&self) -> bool
pub fn is_alive(&self) -> bool
Whether this connection is still worth sending a request down.
The driver task owns the ssh child’s pipes and returns when they close, which drops the receiving end of this channel. So a shut channel is not a proxy for “the ssh died” – it is the same event, observed from the only side that can see it without a syscall.
Racy by nature: a connection alive when this is asked can be gone by the time the
request lands. That is fine, because the caller retries either way. What this prevents
is the other thing – holding a corpse forever and answering every request with
sftp session is gone until somebody restarts the daemon.
Trait Implementations§
Source§impl RemoteFs for SftpFs
impl RemoteFs for SftpFs
Source§async fn read_batch(&self, paths: &[String]) -> Vec<Result<Vec<u8>>> ⓘ
async fn read_batch(&self, paths: &[String]) -> Vec<Result<Vec<u8>>> ⓘ
Read whole files. Implementations must issue every request before awaiting
any reply; doing otherwise silently reintroduces O(N) round trips.
Source§async fn read_ranges(&self, reqs: &[RangeReq]) -> Vec<Result<Vec<u8>>> ⓘ
async fn read_ranges(&self, reqs: &[RangeReq]) -> Vec<Result<Vec<u8>>> ⓘ
Read byte ranges. Chunking is the implementation’s business; what matters
here is that the whole set is issued together, so a one-megabyte range costs
one round trip rather than the thirty-two its chunks would suggest.
Source§async fn home(&self) -> Result<String>
async fn home(&self) -> Result<String>
The absolute path a fresh session starts in — the account’s home directory. Read more
Source§async fn list_dirs(&self, paths: &[String]) -> Vec<Result<Vec<Entry>>> ⓘ
async fn list_dirs(&self, paths: &[String]) -> Vec<Result<Vec<Entry>>> ⓘ
List several directories at once. One listing carries every entry’s attrs,
which is what removes per-file stat from the page path; batching the
listings is what holds a symlink check over a deep path at one round trip
rather than one per path component.
Source§fn round_trips(&self) -> u64
fn round_trips(&self) -> u64
Flushes issued so far. One flush is one remote round trip, so this is the
invariant made observable. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for SftpFs
impl !UnwindSafe for SftpFs
impl Freeze for SftpFs
impl Send for SftpFs
impl Sync for SftpFs
impl Unpin for SftpFs
impl UnsafeUnpin for SftpFs
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Mutably borrows from an owned value. Read more