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 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§
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. (
ptr_alignment_type #102070)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