An opened file in a filesystem.
struct File {
/* private fields */
}| Name | Description |
|---|---|
| current_dir | Creates a file that points to the current working directory. |
| invalid | Creates a file on which every operation fails. |
| memory | Creates a memory-backed file. |
| open | Opens a file with custom flags. |
| open_read | Opens a file in read-only mode. |
| Receiver | Name | Description |
|---|---|---|
&self | add_seals | Adds seals to this file. |
&self | advise | Advises the kernel that a range in the file will have a certain usage pattern. |
&self | change_mode | Changes the mode of this file. |
&self | change_owner | Changes the owner of this file. |
&mut self | close | Closes the file. |
&self | collapse | Removes a range from the file and closes the gap. |
&self | create_hole | Creates a hole in the file. |
&self | data_sync | Flushes enough data and mate-data to the disk that the content of the file can be read again. |
&self | duplicate | Creates a new file referring to the same file description. |
&self | filename | Returns the path of the file that was used to open this file. |
&self | filename_buf | Returns the path of the file that was used to open this file. |
&self | fs_info | Returns information about the filesystem in which this file in stored. |
&self | gather_write | Writes from multiple buffers to the file. |
&self | gather_write_at | Writes from multiple buffers to an offset in the file. |
&self | get_attr | Gets an attribute of this file. |
&self | get_attr_buf | Gets an attribute of this file. |
&self | get_status_flags | Retrieves the file status flags and access mode. |
&self | info | Retrieves information about the file. |
&self | link | Creates a hard link to the file. |
&self | link_rel_to | Creates a hard link to this file relative to a directory. |
&self | list_attr | Returns an iterator over the attributes in this file. |
&self | list_attr_buf | Returns an iterator over the attributes in this file. |
&self | list_attr_size | Returns the buffer size required in a |
&self | lock_exclusive | Tries to lock this file exclusively. |
&self | lock_shared | Tries to lock this file shared. |
&self | read | Reads from the file. |
&self | read_at | Reads from a position in the file. |
&self | readahead | Initiates readahead of the specified range. |
&self | rel_can_access | Returns whether a path relative to this file can be accessed. |
&self | rel_change_mode | Change the mode of a file relative to this file. |
&self | rel_change_owner | Changes the owner of a file relative to this file. |
&self | rel_change_owner_no_follow | Changes the owner of a file relative to this file without following symlinks. |
&self | rel_create_device | Creates a device special file relative to this file. |
&self | rel_create_dir | Creates a directory relative to this file. |
&self | rel_create_file | Creates a file at a path relative to this file. |
&self | rel_exchange | Atomically exchanges two files relative to this file. |
&self | rel_exists | Returns whether a path relative to this file points to an existing file. |
&self | rel_info | Returns information about a path relative to this file. |
&self | rel_info_no_follow | Returns information about a path relative to this file without following symlinks. |
&self | rel_open | Opens a path relative to this file. |
&self | rel_open_read | Opens a path for reading relative to this file. |
&self | rel_read_link | Reads the target of a symbolic link relative to this file. |
&self | rel_read_link_buf | Reads the target of a symbolic link relative to this file. |
&self | rel_real_path | Returns a canonicalized absolute path relative to this file. |
&self | rel_real_path_buf | Returns a canonicalized absolute path relative to this file. |
&self | rel_remove | Removes a link. |
&self | rel_rename | Renames a file relative to this file. |
&self | rel_set_times | Changes the access and modification times of a file pointed to by a path relative to this file. |
&self | rel_set_times_no_follow | Changes the access and modification times of a file pointed to by a path relative to this file without following symlinks. |
&self | rel_symlink | Creates a symlink relative to this file. |
&self | remove_attr | Removes an attribute of this file. |
&self | reserve | Reserves space for this file in the filesystem. |
&self | scatter_read | Reads from the file into multiple buffers. |
&self | scatter_read_at | Reads from a position in the file into multiple buffers. |
&self | seals | Returns the seals of this file. |
&self | seek | Changes the read/write position of the file. |
&self | set_attr | Sets an attribute of this file. |
&self | set_cwd | Set the current working directory to the directory represented by this file. |
&self | set_len | Changes the length of the file. |
&self | set_times | Changes the access and modification times of the file. |
&self | sync | Flushes all data and meta-data of the file to the disk. |
&self | sync_filesystem | Flushes all data and meta-data of the filesystem containing the file to the disk. |
&self | try_lock_exclusive | Tries to lock this file exclusively without blocking. |
&self | try_lock_shared | Tries to lock this file shared without blocking. |
&self | unlock | Unlocks this file. |
&self | write | Writes to the file. |
&self | write_at | Writes to an offset in the file. |
&self | zero | Zeroes a range in the file. |
| Name | Description |
|---|---|
| Drop | Objects with a destructor. |
| Eq | Objects that implement the binary |
| FDContainer | Objects that are file descriptor wrappers. |
| Read | Objects that wrap a byte-stream for reading. |
| UndefState | Types that are not valid when they contain certain bit patterns. |
| Write | Objects that wrap a byte-stream for writing. |