Rust Search

Find the best content on Rust, curated by the community; a search engine for Rustaceans.
doc.rust-lang.org
pub fn set_modified(&self, time: SystemTime) -> io::Result<()>
Changes the modification time of the underlying file.
method std Stable since 1.75.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn set_len(&self, size: u64) -> io::Result<()>
Truncates or extends the underlying file, updating the size of this file to become size.
method std Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn options() -> OpenOptions
Returns a new OpenOptions object.
associated_function std Stable since 1.58.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn open<P>(path: P) -> io::Result<File>
Attempts to open a file in read-only mode.
associated_function std Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn metadata(&self) -> io::Result<Metadata>
Queries metadata about the underlying file.
method std Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn lock_shared(&self) -> io::Result<()>
Acquire a shared (non-exclusive) lock on the file. Blocks until the lock can be acquired.
method std Stable since 1.89.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn lock(&self) -> io::Result<()>
Acquire an exclusive lock on the file. Blocks until the lock can be acquired.
method std Stable since 1.89.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn create_new<P>(path: P) -> io::Result<File>
Creates a new file in read-write mode; error if the file exists.
associated_function std Stable since 1.77.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn create<P>(path: P) -> io::Result<File>
Opens a file in write-only mode.
associated_function std Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub struct File
An object providing access to an open file on the filesystem.
struct std Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn path(&self) -> PathBuf
Returns the full path to the file that this entry represents.
method std Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn metadata(&self) -> io::Result<Metadata>
Returns the metadata for the file that this entry points at.
method std Stable since 1.1.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn file_type(&self) -> io::Result<FileType>
Returns the file type for the file that this entry points at.
method std Stable since 1.1.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn file_name(&self) -> OsString
Returns the file name of this directory entry without any leading path component(s).
method std Stable since 1.1.0 Version 1.100.0-nightly
doc.rust-lang.org
pub struct DirEntry
Entries returned by the ReadDir iterator.
struct std Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn recursive(&mut self, recursive: bool) -> &mut Self
Indicates that directories should be created recursively, creating all parent directories. Parents that do not exist are created with the same security and permissions settings.
method std Stable since 1.6.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn new() -> DirBuilder
Creates a new set of options with default mode/security settings for all platforms and also non-recursive.
associated_function std Stable since 1.6.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn create<P>(&self, path: P) -> io::Result<()>
Creates the specified directory with the options configured in this builder.
method std Stable since 1.6.0 Version 1.100.0-nightly
doc.rust-lang.org
pub struct DirBuilder
A builder used to create directories in various manners.
struct std Stable since 1.6.0 Version 1.100.0-nightly
doc.rust-lang.org
pub mod fs
Filesystem manipulation operations.
module std Stable since 1.0.0 Version 1.100.0-nightly
"Do or do not. There is a try!"

Search tips

Type anything to search across articles, videos (including conference talks), podcasts, research, crates, and Rust API documentation. These operators give you finer control — click an example to try it.

Find pages containing all your words. Pages where the words appear together rank higher.
Quote part of your query to keep those words together as an exact phrase within a larger search.
Wrap the whole query in quotes for a verbatim search that matches text exactly, punctuation and all — perfect for Rust syntax. Needs at least 3 characters.
Put ! first to open the top result immediately. Quote the whole query for a literal leading bang, as in '!Send'. Bangs elsewhere, such as println!, stay literal. Browser and launcher shortcuts can invoke this directly. See search integrations.
Limit results to a single site. Works on its own () too. One site: per search.

Use the tabs and filters above the results to narrow by content type, publication year, and sort order.