[−][src]Struct unix::file::File
File descriptor, closed on drop
Implementations
impl File
[src]
pub fn chmod(&self, mode: FileMode) -> 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
fn map(&self, perm: Perm, seg: Option<Segment>) -> Result<Map, Error>
[src]
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
fn readv(&mut self, bufs: &mut [&mut [u8]]) -> Result<usize, Self::Err>
[src]
fn read(&mut self, buf: &mut [T]) -> Result<usize, Self::Err>
fn try_read_full(&mut self, buf: &mut [T]) -> Result<usize, (Self::Err, usize)>
fn read_full<E>(&mut self, buf: &mut [T]) -> Result<(), (E, usize)> where
E: From<Self::Err> + From<EndOfFile>,
E: From<Self::Err> + From<EndOfFile>,
fn size_hint(&self) -> (usize, Option<usize>)
fn data(self) -> Data<Self, T>
fn read_onto_vec<A>(&mut self, xs: &mut Vec<T, A>) -> Result<usize, Self::Err> where
A: Alloc,
A: Alloc,
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,
E: From<Self::Err> + From<NoMemory>,
P: FnMut(T) -> bool,
impl TryClone for File
[src]
type Error = Error
fn try_clone(&self) -> Result<Self, Error>
[src]
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.
fn try_from(file: File) -> Result<Self, Error>
[src]
impl Write<u8> for File
[src]
type Err = Error
fn writev(&mut self, bufs: &[&[u8]]) -> Result<usize, Self::Err>
[src]
fn flush(&mut self) -> Result<(), Self::Err>
[src]
fn write(&mut self, buf: &[T]) -> Result<usize, Self::Err>
fn write_all(&mut self, buf: &[T]) -> Result<(), (Self::Err, usize)> where
Self::Err: From<EndOfFile>,
Self::Err: From<EndOfFile>,
fn write_all_e(
&mut self,
buf: &[T]
) -> Result<(), (Either<EndOfFile, Self::Err>, usize)>
&mut self,
buf: &[T]
) -> Result<(), (Either<EndOfFile, Self::Err>, usize)>
impl Write for File
[src]
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,
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<'a, T, R> Read<T> for R where
R: DerefMut + ?Sized,
T: Copy,
<R as Deref>::Target: Read<T>,
R: DerefMut + ?Sized,
T: Copy,
<R as Deref>::Target: Read<T>,
type Err = <<R as Deref>::Target as Read<T>>::Err
fn read(&mut self, buf: &mut [T]) -> Result<usize, <R as Read<T>>::Err>
fn readv(&mut self, buf: &mut [&mut [T]]) -> Result<usize, <R as Read<T>>::Err>
fn try_read_full(&mut self, buf: &mut [T]) -> Result<usize, (Self::Err, usize)>
fn read_full<E>(&mut self, buf: &mut [T]) -> Result<(), (E, usize)> where
E: From<Self::Err> + From<EndOfFile>,
E: From<Self::Err> + From<EndOfFile>,
fn size_hint(&self) -> (usize, Option<usize>)
fn data(self) -> Data<Self, T>
fn read_onto_vec<A>(&mut self, xs: &mut Vec<T, A>) -> Result<usize, Self::Err> where
A: Alloc,
A: Alloc,
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,
E: From<Self::Err> + From<NoMemory>,
P: FnMut(T) -> bool,
impl<T> TryClone for T where
T: Clone,
[src]
T: Clone,
type Error = Void
fn try_clone(&self) -> Result<T, Void>
[src]
fn try_clone_from(&mut self, other: &T) -> Result<(), Void>
[src]
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.
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<'a, T, W> Write<T> for W where
T: Copy,
W: DerefMut + ?Sized,
<W as Deref>::Target: Write<T>,
T: Copy,
W: DerefMut + ?Sized,
<W as Deref>::Target: Write<T>,
type Err = <<W as Deref>::Target as Write<T>>::Err
fn write(&mut self, buf: &[T]) -> Result<usize, <W as Write<T>>::Err>
fn writev(&mut self, buf: &[&[T]]) -> Result<usize, <W as Write<T>>::Err>
fn flush(&mut self) -> Result<(), <W as Write<T>>::Err>
fn write_all(&mut self, buf: &[T]) -> Result<(), (Self::Err, usize)> where
Self::Err: From<EndOfFile>,
Self::Err: From<EndOfFile>,
fn write_all_e(
&mut self,
buf: &[T]
) -> Result<(), (Either<EndOfFile, Self::Err>, usize)>
&mut self,
buf: &[T]
) -> Result<(), (Either<EndOfFile, Self::Err>, usize)>