[−][src]Struct unix::file::File
File descriptor, closed on drop
Implementations
impl File
[src]
pub fn chmod(&self, mode: Mode) -> Result<(), Error>
[src]
Change the mode of the file.
pub fn stat(&self) -> Result<Stat, Error>
[src]
Return information about the file.
pub fn sync(&self, metadata: bool) -> Result<(), Error>
[src]
Flush all cached modifications of the file to the device.
If metadata
, also flush modifications of the metadata.
pub fn truncate(&self, length: u64) -> Result<(), Error>
[src]
Truncate the file to the given length.
pub fn exec(&self, argv: &Nul<&Str>, envp: &Nul<&Str>) -> Result<Void, Error>
[src]
Execute the program file.
The current program of the calling process is replaced with the new one, with a fresh stack, heap, and data segment.
argv
is an array of argument strings to pass to the new program. By convention, the first should be the name of the program file.
env
is an array of strings, conventionally of form "key=value", which are passed as the environment.
pub fn fd(&self) -> isize
[src]
Return the file descriptor of the File
.
pub fn new(fd: isize) -> Option<Self>
[src]
Make a File
of a file descriptor, which is checked for validity.
pub const fn new_unchecked(fd: isize) -> Self
[src]
Make a File
of a file descriptor, which is not checked.
Trait Implementations
impl Debug for File
[src]
impl Drop for File
[src]
impl MapExt for File
[src]
type MapSpec = Option<Segment>
Specifier of which part of value to map
pub fn map(&self, perm: Perm, seg: Option<Segment>) -> Result<Map, Error>
[src]
pub unsafe fn map_at(
&self,
loc: *mut u8,
perm: Perm,
seg: Option<Segment>
) -> Result<Map, Error>
[src]
&self,
loc: *mut u8,
perm: Perm,
seg: Option<Segment>
) -> Result<Map, Error>
impl Read<u8> for File
[src]
type Err = Error
pub fn readv(&mut self, bufs: &mut [&mut [u8]]) -> Result<usize, Self::Err>
[src]
pub fn read(&mut self, buf: &mut [T]) -> Result<usize, Self::Err>
[src]
pub fn try_read_full(
&mut self,
buf: &mut [T]
) -> Result<usize, (Self::Err, usize)>
[src]
&mut self,
buf: &mut [T]
) -> Result<usize, (Self::Err, usize)>
pub fn read_full<E>(&mut self, buf: &mut [T]) -> Result<(), (E, usize)> where
E: From<Self::Err> + From<EndOfFile>,
[src]
E: From<Self::Err> + From<EndOfFile>,
pub fn size_hint(&self) -> (usize, Option<usize>)
[src]
pub fn data(self) -> Data<Self, T>
[src]
pub fn read_onto_vec<A>(
&mut self,
xs: &mut Vec<T, A>
) -> Result<usize, Self::Err> where
A: Alloc,
[src]
&mut self,
xs: &mut Vec<T, A>
) -> Result<usize, Self::Err> where
A: Alloc,
pub fn split<P, E>(self, p: P, keep_delim: bool) -> Split<Self, T, P, E> where
E: From<Self::Err> + From<NoMemory>,
P: FnMut(T) -> bool,
[src]
E: From<Self::Err> + From<NoMemory>,
P: FnMut(T) -> bool,
impl TryClone for File
[src]
type Error = Error
pub fn try_clone(&self) -> Result<Self, Error>
[src]
pub fn try_clone_from(&mut self, other: &Self) -> Result<(), Error>
[src]
impl TryFrom<File> for Entries
[src]
type Error = Error
The type returned in the event of a conversion error.
pub fn try_from(file: File) -> Result<Self, Error>
[src]
impl Write for File
[src]
pub fn write_str(&mut self, s: &str) -> Result
[src]
pub fn write_char(&mut self, c: char) -> Result<(), Error>
1.1.0[src]
pub fn write_fmt(&mut self, args: Arguments<'_>) -> Result<(), Error>
1.0.0[src]
impl Write<u8> for File
[src]
type Err = Error
pub fn writev(&mut self, bufs: &[&[u8]]) -> Result<usize, Self::Err>
[src]
pub fn flush(&mut self) -> Result<(), Self::Err>
[src]
pub fn write(&mut self, buf: &[T]) -> Result<usize, Self::Err>
[src]
pub fn write_all(&mut self, buf: &[T]) -> Result<(), (Self::Err, usize)> where
Self::Err: From<EndOfFile>,
[src]
Self::Err: From<EndOfFile>,
pub fn write_all_e(
&mut self,
buf: &[T]
) -> Result<(), (Either<EndOfFile, Self::Err>, usize)>
[src]
&mut self,
buf: &[T]
) -> Result<(), (Either<EndOfFile, Self::Err>, usize)>
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,