Struct File
pub struct File(pub(in ::sys::fs::unix) FileDesc);
Fields
0: FileDesc
Implementations
impl File
fn open(path: &Path, opts: &OpenOptions) -> Result<File>fn open_c(path: &CStr, opts: &OpenOptions) -> Result<File>fn file_attr(&self) -> Result<FileAttr>fn fsync(&self) -> Result<()>fn datasync(&self) -> Result<()>fn lock(&self) -> Result<()>fn try_lock(&self) -> Result<(), TryLockError>fn unlock(&self) -> Result<()>fn truncate(&self, size: u64) -> Result<()>fn read(&self, buf: &mut [u8]) -> Result<usize>fn read_vectored(&self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize>fn is_read_vectored(&self) -> boolfn read_at(&self, buf: &mut [u8], offset: u64) -> Result<usize>fn read_buf(&self, cursor: BorrowedCursor<'_, u8>) -> Result<()>fn read_buf_at(&self, cursor: BorrowedCursor<'_, u8>, offset: u64) -> Result<()>fn read_vectored_at(&self, bufs: &mut [IoSliceMut<'_>], offset: u64) -> Result<usize>fn write(&self, buf: &[u8]) -> Result<usize>fn write_vectored(&self, bufs: &[IoSlice<'_>]) -> Result<usize>fn is_write_vectored(&self) -> boolfn write_at(&self, buf: &[u8], offset: u64) -> Result<usize>fn write_vectored_at(&self, bufs: &[IoSlice<'_>], offset: u64) -> Result<usize>fn flush(&self) -> Result<()>fn seek(&self, pos: SeekFrom) -> Result<u64>fn size(&self) -> Option<Result<u64>>fn tell(&self) -> Result<u64>fn duplicate(&self) -> Result<File>fn set_permissions(&self, perm: FilePermissions) -> Result<()>fn set_times(&self, times: FileTimes) -> Result<()>
Trait Implementations
impl AsFd for File
fn as_fd(&self) -> BorrowedFd<'_>
impl AsInner<FileDesc> for File
fn as_inner(&self) -> &FileDesc
impl AsInnerMut<FileDesc> for File
fn as_inner_mut(&mut self) -> &mut FileDesc
impl AsRawFd for File
fn as_raw_fd(&self) -> RawFd
impl Debug for File
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl FromInner<FileDesc> for File
fn from_inner(file_desc: FileDesc) -> Self
impl FromRawFd for File
unsafe fn from_raw_fd(raw_fd: RawFd) -> Self
impl IntoInner<FileDesc> for File
fn into_inner(self) -> FileDesc
impl IntoRawFd for File
fn into_raw_fd(self) -> RawFd
Auto Trait Implementations
impl Freeze for File
impl RefUnwindSafe for File
impl Send for File
impl Sync for File
impl Unpin for File
impl UnsafeUnpin for File
impl UnwindSafe for File
Blanket Implementations
impl<T> Any for File
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for File
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for File
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> From<T> for File
fn from(t: T) -> TReturns the argument unchanged.
impl<T> SizeHint for File
where
T: ?Sized,
fn lower_bound(&self) -> usizefn upper_bound(&self) -> Option<usize>
impl<T> SizedTypeProperties for File
impl<T, U> Into<U> for File
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for File
where
U: Into<T>,
type Error = Infallible;fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto<U> for File
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>