[][src]Struct cap_async_std::fs::File

pub struct File { /* fields omitted */ }

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 unsafe fn from_std(std: File) -> Self[src]

Constructs a new instance of Self from the given async_std::fs::File.

Safety

async_std::fs::File is not sandboxed and may access any path that the host process has access to.

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]

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

impl<S> AsyncSeekExt for S where
    S: AsyncSeek + ?Sized

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

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> ReadExt for T where
    T: AsyncRead + ?Sized
[src]

impl<T> SeekExt for T where
    T: AsyncSeek + ?Sized
[src]

impl<T> SetTimes for T where
    T: AsRawFd

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<T> WriteExt for T where
    T: AsyncWrite + ?Sized
[src]