Struct cap_std::fs::File [−][src]
pub struct File { /* fields omitted */ }
Expand description
A reference to an open file on a filesystem.
This corresponds to std::fs::File
.
Note that this File
has no open
or create
methods. To open or create
a file, you must first obtain a Dir
containing the path, and then call
Dir::open
or Dir::create
.
Implementations
Constructs a new instance of Self
from the given std::fs::File
.
Ambient Authority
std::fs::File
is not sandboxed and may access any path that the
host process has access to.
Consumes self
and returns a std::fs::File
.
Returns a new OpenOptions
object.
This corresponds to std::fs::File::with_options
.
Attempts to sync all OS-internal metadata to disk.
This corresponds to std::fs::File::sync_all
.
This function is similar to sync_all
, except that it may not synchronize
file metadata to a filesystem.
This corresponds to std::fs::File::sync_data
.
Truncates or extends the underlying file, updating the size of this file to become size.
This corresponds to std::fs::File::set_len
.
Queries metadata about the underlying file.
This corresponds to std::fs::File::metadata
.
Creates a new File
instance that shares the same underlying file handle as the existing
File
instance.
This corresponds to std::fs::File::try_clone
.
Changes the permissions on the underlying file.
This corresponds to std::fs::File::set_permissions
.
Trait Implementations
Extracts the raw handle, without taking any ownership.
Like AsRawHandle::as_raw_handle
and AsRawSocket::as_raw_socket
but can return either type. Read more
Constructs a new I/O object from the specified raw handle. Read more
Consumes this object, returning the raw underlying handle. Read more
Like IntoRawHandle::into_raw_handle
and
IntoRawSocket::into_raw_socket
but can return either type. Read more
Pull some bytes from this source into the specified buffer, returning how many bytes were read. Read more
Like read
, except that it reads into a slice of buffers. Read more
Read the exact number of bytes required to fill buf
. Read more
Read all bytes until EOF in this source, placing them into buf
. Read more
Read all bytes until EOF in this source, appending them to buf
. Read more
can_vector
)Determines if this Read
er has an efficient read_vectored
implementation. Read more
read_initializer
)Determines if this Read
er can work with buffers of uninitialized
memory. Read more
Creates a “by reference” adaptor for this instance of Read
. Read more
Creates an adaptor which will chain this stream with another. Read more
Pull some bytes from this source into the specified buffer, returning how many bytes were read. Read more
Like read
, except that it reads into a slice of buffers. Read more
Read the exact number of bytes required to fill buf
. Read more
Read all bytes until EOF in this source, placing them into buf
. Read more
Read all bytes until EOF in this source, appending them to buf
. Read more
can_vector
)Determines if this Read
er has an efficient read_vectored
implementation. Read more
read_initializer
)Determines if this Read
er can work with buffers of uninitialized
memory. Read more
Creates a “by reference” adaptor for this instance of Read
. Read more
Creates an adaptor which will chain this stream with another. Read more
Write a buffer into this writer, returning how many bytes were written. Read more
Flush this output stream, ensuring that all intermediately buffered contents reach their destination. Read more
Attempts to write an entire buffer into this writer. Read more
can_vector
)Determines if this Write
r has an efficient write_vectored
implementation. Read more
write_all_vectored
)Attempts to write multiple buffers into this writer. Read more
Writes a formatted string into this writer, returning any error encountered. Read more
Write a buffer into this writer, returning how many bytes were written. Read more
Flush this output stream, ensuring that all intermediately buffered contents reach their destination. Read more
Attempts to write an entire buffer into this writer. Read more
can_vector
)Determines if this Write
r has an efficient write_vectored
implementation. Read more
write_all_vectored
)Attempts to write multiple buffers into this writer. Read more
Writes a formatted string into this writer, returning any error encountered. Read more
Auto Trait Implementations
impl RefUnwindSafe for File
impl UnwindSafe for File
Blanket Implementations
Return the contained unsafe handle.
Mutably borrows from an owned value. Read more
Convert self
into an unsafe file.
Convert self
into an unsafe handle.
impl<T> SetTimes for T where
T: AsUnsafeFile,
impl<T> SetTimes for T where
T: AsUnsafeFile,