Rust Search

Find the best content on Rust, curated by the community; a search engine for Rustaceans.
doc.rust-lang.org
pub fn file_type(&self) -> FileType
Returns the file type for this metadata.
method std Stable since 1.1.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn created(&self) -> io::Result<SystemTime>
Returns the creation time listed in this metadata.
method std Stable since 1.10.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn accessed(&self) -> io::Result<SystemTime>
Returns the last access time of this metadata.
method std Stable since 1.10.0 Version 1.100.0-nightly
doc.rust-lang.org
pub struct Metadata
Metadata information about a file.
struct std Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn is_symlink(&self) -> bool
Tests whether this file type represents a symbolic link. The result is mutually exclusive to the results of is_dir and is_file; only zero or one of these tests may pass.
method std Stable since 1.1.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn is_file(&self) -> bool
Tests whether this file type represents a regular file. The result is mutually exclusive to the results of is_dir and is_symlink; only zero or one of these tests may pass.
method std Stable since 1.1.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn is_dir(&self) -> bool
Tests whether this file type represents a directory. The result is mutually exclusive to the results of is_file and is_symlink; only zero or one of these tests may pass.
method std Stable since 1.1.0 Version 1.100.0-nightly
doc.rust-lang.org
pub struct FileType
A structure representing a type of file with accessors for each file type. It is returned by Metadata::file_type method.
struct std Stable since 1.1.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn set_modified(self, t: SystemTime) -> Self
Set the last modified time of a file.
method std Stable since 1.75.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn set_accessed(self, t: SystemTime) -> Self
Set the last access time of a file.
method std Stable since 1.75.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn new() -> Self
Creates a new FileTimes with no times set.
associated_function std Stable since 1.75.0 Version 1.100.0-nightly
doc.rust-lang.org
pub struct FileTimes
Representation of the various timestamps on a file.
struct std Stable since 1.75.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn unlock(&self) -> io::Result<()>
Release all locks on the file.
method std Stable since 1.89.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn try_lock_shared(&self) -> Result<(), TryLockError>
Try to acquire a shared (non-exclusive) lock on the file.
method std Stable since 1.89.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn try_lock(&self) -> Result<(), TryLockError>
Try to acquire an exclusive lock on the file.
method std Stable since 1.89.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn try_clone(&self) -> io::Result<File>
Creates a new File instance that shares the same underlying file handle as the existing File instance. Reads, writes, and seeks will affect both File instances simultaneously.
method std Stable since 1.9.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn sync_data(&self) -> io::Result<()>
This function is similar to sync_all, except that it might not synchronize file metadata to the filesystem.
method std Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn sync_all(&self) -> io::Result<()>
Attempts to sync all OS-internal file content and metadata to disk.
method std Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn set_times(&self, times: FileTimes) -> io::Result<()>
Changes the timestamps of the underlying file.
method std Stable since 1.75.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn set_permissions(&self, perm: Permissions) -> io::Result<()>
Changes the permissions on the underlying file.
method std Stable since 1.16.0 Version 1.100.0-nightly
"You haven’t “fooled” rustc, you are using unsafe code. Unsafe code means that all you can do is fool yourself."

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.