[][src]Struct openssh::RemoteFile

pub struct RemoteFile<'s> { /* fields omitted */ }

A handle to a remote file.

If you opened this file for reading (with Sftp::read_from), you can read from it with std::io::Read. If you opened it for writing (with Sftp::write_to), you can write to it with std::io::Write.

Note that because we are operating against a remote host, errors may take a while to propagate. The various methods on RemoteFile will generally attempt to first check that the file you are trying to access can indeed be accessed in that way, but some errors may not become visible until you call close. In particular, the connection between you and the remote host may buffer bytes, so your write may report that some number of bytes have been successfully written, even though the remote disk is full. Or the file you are reading from may have been removed between when read_from checks that it exists and when it actually tries to read the first byte. For that reason, you should make sure to call close to observe any errors that may have occurred when operating on the remote file.

Implementations

impl<'_> RemoteFile<'_>[src]

pub async fn close(__arg0: Self) -> Result<(), Error>[src]

Close the handle to the remote file.

If the remote file was opened for reading, this will also call flush.

When you close the remote file, any errors on the remote end will also be propagated. This means that you could see errors about remote files not existing, or disks being full, only at the time when you call close.

Trait Implementations

impl<'_> AsyncRead for RemoteFile<'_>[src]

impl<'_> AsyncWrite for RemoteFile<'_>[src]

impl<'s> Debug for RemoteFile<'s>[src]

Auto Trait Implementations

impl<'s> !RefUnwindSafe for RemoteFile<'s>

impl<'s> Send for RemoteFile<'s>

impl<'s> Sync for RemoteFile<'s>

impl<'s> Unpin for RemoteFile<'s>

impl<'s> !UnwindSafe for RemoteFile<'s>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<R> AsyncReadExt for R where
    R: AsyncRead + ?Sized
[src]

impl<W> AsyncWriteExt for W where
    W: AsyncWrite + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,