doc.rust-lang.org
pub enum TryLockError
An enumeration of possible errors which can occur while trying to acquire a lock from the try_lock method and try_lock_shared method on a File.
enum
std
Stable since 1.89.0
Version 1.100.0-nightly
doc.rust-lang.org
pub struct ReadDir
Iterator over the entries in a directory.
struct
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn set_readonly(&mut self, readonly: bool)
Modifies the readonly flag for this set of permissions. If the readonly argument is true, using the resulting Permission will update file permissions to forbid writing. Conversely, if it's false, using the resulting Permission will update file permissions to allow writing.
method
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn readonly(&self) -> bool
Returns true if these permissions describe a readonly (unwritable) file.
method
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub struct Permissions
Representation of the various permissions on a file.
struct
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn write(&mut self, write: bool) -> &mut Self
Sets the option for write access.
method
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn truncate(&mut self, truncate: bool) -> &mut Self
Sets the option for truncating a previous file.
method
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn read(&mut self, read: bool) -> &mut Self
Sets the option for read access.
method
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn open<P>(&self, path: P) -> io::Result<File>
Opens a file at path with the options specified by self.
method
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn new() -> Self
Creates a blank new set of options ready for configuration.
associated_function
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn create_new(&mut self, create_new: bool) -> &mut Self
Sets the option to create a new file, failing if it already exists.
method
std
Stable since 1.9.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn create(&mut self, create: bool) -> &mut Self
Sets the option to create a new file, or open it if it already exists.
method
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn append(&mut self, append: bool) -> &mut Self
Sets the option for the append mode.
method
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub struct OpenOptions
Options and flags which can be used to configure how a file is opened.
struct
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn permissions(&self) -> Permissions
Returns the permissions of the file this metadata is for.
method
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn modified(&self) -> io::Result<SystemTime>
Returns the last modification time listed in this metadata.
method
std
Stable since 1.10.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn len(&self) -> u64
Returns the size of the file, in bytes, this metadata is for.
method
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn is_symlink(&self) -> bool
Returns true if this metadata is for a symbolic link.
method
std
Stable since 1.58.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn is_file(&self) -> bool
Returns true if this metadata is for a regular file. The result is mutually exclusive to the result of Metadata::is_dir, and will be false for symlink metadata obtained from symlink_metadata.
method
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn is_dir(&self) -> bool
Returns true if this metadata is for a directory. The result is mutually exclusive to the result of Metadata::is_file, and will be false for symlink metadata obtained from symlink_metadata.
method
std
Stable since 1.0.0
Version 1.100.0-nightly