pub struct File(FileDesc);Tuple Fields§
§0: FileDescImplementations§
Source§impl File
impl File
pub fn open(path: &Path, opts: &OpenOptions) -> Result<File>
pub fn open_c(path: &CStr, opts: &OpenOptions) -> Result<File>
pub fn file_attr(&self) -> Result<FileAttr>
pub fn fsync(&self) -> Result<()>
pub fn datasync(&self) -> Result<()>
pub fn lock(&self) -> Result<()>
pub fn try_lock(&self) -> Result<(), TryLockError>
pub fn unlock(&self) -> Result<()>
pub fn truncate(&self, size: u64) -> Result<()>
pub fn read(&self, buf: &mut [u8]) -> Result<usize>
pub fn read_vectored(&self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize>
pub fn is_read_vectored(&self) -> bool
pub fn read_at(&self, buf: &mut [u8], offset: u64) -> Result<usize>
pub fn read_buf(&self, cursor: BorrowedCursor<'_, u8>) -> Result<()>
pub fn read_buf_at( &self, cursor: BorrowedCursor<'_, u8>, offset: u64, ) -> Result<()>
pub fn read_vectored_at( &self, bufs: &mut [IoSliceMut<'_>], offset: u64, ) -> Result<usize>
pub fn write(&self, buf: &[u8]) -> Result<usize>
pub fn write_vectored(&self, bufs: &[IoSlice<'_>]) -> Result<usize>
pub fn is_write_vectored(&self) -> bool
pub fn write_at(&self, buf: &[u8], offset: u64) -> Result<usize>
pub fn write_vectored_at( &self, bufs: &[IoSlice<'_>], offset: u64, ) -> Result<usize>
pub fn flush(&self) -> Result<()>
pub fn seek(&self, pos: SeekFrom) -> Result<u64>
pub fn size(&self) -> Option<Result<u64>>
pub fn tell(&self) -> Result<u64>
pub fn duplicate(&self) -> Result<File>
pub fn set_permissions(&self, perm: FilePermissions) -> Result<()>
pub fn set_times(&self, times: FileTimes) -> Result<()>
Trait Implementations§
Source§impl AsFd for File
impl AsFd for File
Source§fn as_fd(&self) -> BorrowedFd<'_>
fn as_fd(&self) -> BorrowedFd<'_>
Available on Hermit or Motor OS or Trusty or Unix or WASI only.
Borrows the file descriptor. Read more
Source§impl AsInnerMut<FileDesc> for File
impl AsInnerMut<FileDesc> for File
fn as_inner_mut(&mut self) -> &mut FileDesc
Auto Trait Implementations§
impl Forget for File
impl Freeze for Filewhere
I32NotAllOnes: Freeze,
impl Move for File
impl RefUnwindSafe for Filewhere
I32NotAllOnes: RefUnwindSafe,
impl Send for Filewhere
I32NotAllOnes: Send,
impl Sync for Filewhere
I32NotAllOnes: Sync,
impl Unpin for Filewhere
I32NotAllOnes: Unpin,
impl UnsafeUnpin for Filewhere
I32NotAllOnes: UnsafeUnpin,
impl UnwindSafe for Filewhere
I32NotAllOnes: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> SizeHint for Twhere
T: ?Sized,
impl<T> SizeHint for Twhere
T: ?Sized,
Source§default fn lower_bound(&self) -> usize
default fn lower_bound(&self) -> usize
🔬This is a nightly-only experimental API. (
core_io_internals)Returns a lower bound on the number of elements this container-like item
contains.
For example, an array
[u8; 12] could return any value between 0 and
12 inclusively as a correct implementation. Read moreSource§impl<T> SizedTypeProperties for T
impl<T> SizedTypeProperties for T
Source§#[doc(hidden)]const SIZE: usize
#[doc(hidden)]const SIZE: usize
🔬This is a nightly-only experimental API. (
sized_type_properties)Source§#[doc(hidden)]const ALIGN: usize
#[doc(hidden)]const ALIGN: usize
🔬This is a nightly-only experimental API. (
sized_type_properties)Source§#[doc(hidden)]const ALIGNMENT: Alignment
#[doc(hidden)]const ALIGNMENT: Alignment
🔬This is a nightly-only experimental API. (
sized_type_properties)Source§#[doc(hidden)]const IS_ZST: bool
#[doc(hidden)]const IS_ZST: bool
🔬This is a nightly-only experimental API. (
sized_type_properties)Source§#[doc(hidden)]const LAYOUT: Layout
#[doc(hidden)]const LAYOUT: Layout
🔬This is a nightly-only experimental API. (
sized_type_properties)Source§#[doc(hidden)]const MAX_SLICE_LEN: usize
#[doc(hidden)]const MAX_SLICE_LEN: usize
🔬This is a nightly-only experimental API. (
sized_type_properties)The largest safe length for a
[Self]. Read more