pub struct File(FileDesc);
Tuple Fields§
§0: FileDesc
Implementations§
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<'_>) -> 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 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<'_>
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 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> SizedTypeProperties for T
impl<T> SizedTypeProperties for T
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