AsyncFile

Struct AsyncFile 

Source
pub struct AsyncFile(/* private fields */);
Available on crate feature fs only.

Implementations§

Source§

impl AsyncFile

Source

pub async fn close(self) -> Result<()>

Source

pub async fn sync_all(&self) -> Result<()>

Source

pub async fn sync_data(&self) -> Result<()>

Source

pub fn try_unwrap(self) -> StdResult<RawAsyncFile, AsyncFile>

Source

pub fn get_raw_weak(&self) -> Weak<RawAsyncFile>

Source

pub fn options() -> OpenOptions

Source

pub async fn create<P: AsRef<Path>>(path: P) -> Result<AsyncFile>

Source

pub async fn create_new<P: AsRef<Path>>(path: P) -> Result<AsyncFile>

Source

pub async fn open<P: AsRef<Path>>(path: P) -> Result<AsyncFile>

Source

pub async fn metadata(&self) -> Result<Metadata>

Source

pub fn try_clone(&self) -> Result<AsyncFile>

Source

pub async fn set_times(&self, times: FileTimes) -> Result<()>

Source

pub async fn set_modified(&self, time: SystemTime) -> Result<()>

Source

pub async fn set_permissions(&self, perm: Permissions) -> Result<()>

Source

pub async fn set_len(&self, len: u64) -> Result<()>

Source§

impl AsyncFile

Source

pub fn seek_ext(&self, pos: SeekFrom) -> Result<u64>

Available on Unix only.

Trait Implementations§

Source§

impl AsFd for AsyncFile

Available on Unix only.
Source§

fn as_fd(&self) -> BorrowedFd<'_>

Borrows the file descriptor. Read more
Source§

impl AsRawFd for AsyncFile

Available on Unix only.
Source§

fn as_raw_fd(&self) -> RawFd

Extracts the raw file descriptor. Read more
Source§

impl AsRef<RawAsyncFile> for AsyncFile

Source§

fn as_ref(&self) -> &RawAsyncFile

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsyncRead for AsyncFile

Available on crate feature io only.
Source§

type Future = Read

Source§

fn read(&self, buf: BytesMut) -> Read

Source§

impl AsyncReadOverlapped for AsyncFile

Available on crate feature io only.
Source§

type Future = Read

Source§

fn read_at(&self, buf: BytesMut, offset: u64) -> Read

Source§

impl AsyncWrite for AsyncFile

Available on crate feature io only.
Source§

type Future = Write

Source§

fn write(&self, buf: Bytes) -> Write

Source§

impl AsyncWriteOverlapped for AsyncFile

Available on crate feature io only.
Source§

type Future = Write

Source§

fn write_at(&self, buf: Bytes, offset: u64) -> Write

Source§

impl Debug for AsyncFile

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Deref for AsyncFile

Source§

type Target = RawAsyncFile

The resulting type after dereferencing.
Source§

fn deref(&self) -> &RawAsyncFile

Dereferences the value.
Source§

impl From<RawAsyncFile> for AsyncFile

Source§

fn from(value: RawAsyncFile) -> Self

Converts to this type from the input type.
Source§

impl Seek for &AsyncFile

Source§

fn seek(&mut self, pos: SeekFrom) -> Result<u64>

Seek to an offset, in bytes, in a stream. Read more
1.55.0 · Source§

fn rewind(&mut self) -> Result<(), Error>

Rewind to the beginning of a stream. Read more
Source§

fn stream_len(&mut self) -> Result<u64, Error>

🔬This is a nightly-only experimental API. (seek_stream_len)
Returns the length of this stream (in bytes). Read more
1.51.0 · Source§

fn stream_position(&mut self) -> Result<u64, Error>

Returns the current seek position from the start of the stream. Read more
1.80.0 · Source§

fn seek_relative(&mut self, offset: i64) -> Result<(), Error>

Seeks relative to the current position. Read more
Source§

impl Seek for AsyncFile

Source§

fn seek(&mut self, pos: SeekFrom) -> Result<u64>

Seek to an offset, in bytes, in a stream. Read more
1.55.0 · Source§

fn rewind(&mut self) -> Result<(), Error>

Rewind to the beginning of a stream. Read more
Source§

fn stream_len(&mut self) -> Result<u64, Error>

🔬This is a nightly-only experimental API. (seek_stream_len)
Returns the length of this stream (in bytes). Read more
1.51.0 · Source§

fn stream_position(&mut self) -> Result<u64, Error>

Returns the current seek position from the start of the stream. Read more
1.80.0 · Source§

fn seek_relative(&mut self, offset: i64) -> Result<(), Error>

Seeks relative to the current position. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<A> AsyncReadExt for A
where A: AsyncRead,

Source§

fn read_appending( &self, bytes: BytesMut, len: usize, ) -> ReadAppending<<A as AsyncRead>::Future>

Available on crate feature io only.
Source§

fn read_all_appending(&self, bytes: BytesMut) -> ReadAllAppending<'_, A>

Available on crate feature io only.
Source§

fn read_exact(&self, buf: BytesMut) -> ReadExact<'_, A>

Available on crate feature io only.
Source§

fn read_to_bytes(&self, len: usize) -> ReadToBytesAt<<A as AsyncRead>::Future>

Available on crate feature io only.
Source§

fn read_all_to_bytes(&self) -> ReadAllToBytes<'_, A>

Available on crate feature io only.
Source§

fn read_exact_to_bytes(&self, len: usize) -> ReadExactToBytes<'_, A>

Available on crate feature io only.
Source§

impl<A> AsyncReadOverlappedExt for A

Source§

fn read_exact_at(&self, buf: BytesMut, offset: u64) -> ReadExactAt<'_, A>

Available on crate feature io only.
Source§

fn read_to_bytes_at( &self, len: usize, offset: u64, ) -> ReadToBytesAt<<A as AsyncReadOverlapped>::Future>

Available on crate feature io only.
Source§

fn read_exact_to_bytes_at( &self, len: usize, offset: u64, ) -> ReadExactToBytesAt<'_, A>

Available on crate feature io only.
Source§

impl<W> AsyncWriteExt for W
where W: AsyncWrite,

Source§

fn write_all(&self, bytes: Bytes) -> WriteAll<'_, W>

Available on crate feature io only.
Source§

impl<W> AsyncWriteOverlappedExt for W

Source§

fn write_all_at(&self, bytes: Bytes, offset: u64) -> WriteAllAt<'_, W>

Available on crate feature io only.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.