Struct std::sys::unix::fs::File

source ·
pub struct File(FileDesc);

Tuple Fields§

§0: FileDesc

Implementations§

source§

impl File

source

pub fn open(path: &Path, opts: &OpenOptions) -> Result<File>

source

pub fn open_c(path: &CStr, opts: &OpenOptions) -> Result<File>

source

pub fn file_attr(&self) -> Result<FileAttr>

source

pub fn fsync(&self) -> Result<()>

source

pub fn datasync(&self) -> Result<()>

source

pub fn truncate(&self, size: u64) -> Result<()>

source

pub fn read(&self, buf: &mut [u8]) -> Result<usize>

source

pub fn read_vectored(&self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize>

source

pub fn is_read_vectored(&self) -> bool

source

pub fn read_at(&self, buf: &mut [u8], offset: u64) -> Result<usize>

source

pub fn read_buf(&self, cursor: BorrowedCursor<'_>) -> Result<()>

source

pub fn read_vectored_at( &self, bufs: &mut [IoSliceMut<'_>], offset: u64 ) -> Result<usize>

source

pub fn write(&self, buf: &[u8]) -> Result<usize>

source

pub fn write_vectored(&self, bufs: &[IoSlice<'_>]) -> Result<usize>

source

pub fn is_write_vectored(&self) -> bool

source

pub fn write_at(&self, buf: &[u8], offset: u64) -> Result<usize>

source

pub fn write_vectored_at( &self, bufs: &[IoSlice<'_>], offset: u64 ) -> Result<usize>

source

pub fn flush(&self) -> Result<()>

source

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

source

pub fn duplicate(&self) -> Result<File>

source

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

source

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

Trait Implementations§

source§

impl AsFd for File

source§

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

Borrows the file descriptor. Read more
source§

impl AsRawFd for File

source§

fn as_raw_fd(&self) -> RawFd

Extracts the raw file descriptor. Read more
source§

impl Debug for File

source§

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

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

impl From<File> for Stdio

source§

fn from(file: File) -> Stdio

Converts to this type from the input type.
source§

impl FromRawFd for File

source§

unsafe fn from_raw_fd(raw_fd: RawFd) -> Self

Constructs a new instance of Self from the given raw file descriptor. Read more
source§

impl IntoRawFd for File

source§

fn into_raw_fd(self) -> RawFd

Consumes this object, returning the raw underlying file descriptor. Read more

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§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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<T, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.