[−][src]Struct cap_async_std::fs::File
A reference to an open file on a filesystem.
This corresponds to async_std::fs::File
.
Note that this File
has no open
or create
methods. To open or create
a file, you must first obtain a Dir
containing the path, and then call
Dir::open
or Dir::create
.
Implementations
impl File
[src][−]
pub fn from_std(std: File) -> Self
[src][−]
Constructs a new instance of Self
from the given async_std::fs::File
.
pub fn into_std(self) -> File
[src][−]
Consumes self
and returns an async_std::fs::File
.
pub async fn sync_all<'_>(&'_ self) -> Result<()>
[src][−]
Attempts to sync all OS-internal metadata to disk.
This corresponds to async_std::fs::File::sync_all
.
pub async fn sync_data<'_>(&'_ self) -> Result<()>
[src][−]
This function is similar to sync_all
, except that it may not synchronize
file metadata to a filesystem.
This corresponds to async_std::fs::File::sync_data
.
pub async fn set_len<'_>(&'_ self, size: u64) -> Result<()>
[src][−]
Truncates or extends the underlying file, updating the size of this file to become size.
This corresponds to async_std::fs::File::set_len
.
pub async fn metadata<'_>(&'_ self) -> Result<Metadata>
[src][−]
Queries metadata about the underlying file.
This corresponds to async_std::fs::File::metadata
.
pub async fn set_permissions<'_>(&'_ self, perm: Permissions) -> Result<()>
[src][−]
Changes the permissions on the underlying file.
This corresponds to async_std::fs::File::set_permissions
.
Trait Implementations
impl AsRawFd for File
[src][+]
impl AsyncRead for File
[src][+]
impl<'_> AsyncRead for &'_ File
[src][+]
impl AsyncSeek for File
[src][+]
impl<'_> AsyncSeek for &'_ File
[src][+]
impl AsyncWrite for File
[src][+]
impl<'_> AsyncWrite for &'_ File
[src][+]
impl Debug for File
[src][+]
impl FromRawFd for File
[src][+]
impl IntoRawFd for File
[src][+]
Auto Trait Implementations
impl !RefUnwindSafe for File
impl Send for File
impl Sync for File
impl Unpin for File
impl !UnwindSafe for File
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,
impl<R> AsyncReadExt for R where
R: AsyncRead + ?Sized,
[+]
R: AsyncRead + ?Sized,
impl<S> AsyncSeekExt for S where
S: AsyncSeek + ?Sized,
[+]
S: AsyncSeek + ?Sized,
impl<W> AsyncWriteExt for W where
W: AsyncWrite + ?Sized,
[+]
W: AsyncWrite + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> From<T> for T
[src][+]
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<T> ReadExt for T where
T: AsyncRead + ?Sized,
[src][+]
T: AsyncRead + ?Sized,
impl<T> SeekExt for T where
T: AsyncSeek + ?Sized,
[src][+]
T: AsyncSeek + ?Sized,
impl<T> SetTimes for T where
T: AsRawFd,
[+]
T: AsRawFd,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,
impl<T> WriteExt for T where
T: AsyncWrite + ?Sized,
[src][+]
T: AsyncWrite + ?Sized,