summaryrefslogtreecommitdiffstats
path: root/vendor/rustix/src/fs/seek_from.rs
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/rustix/src/fs/seek_from.rs')
-rw-r--r--vendor/rustix/src/fs/seek_from.rs29
1 files changed, 17 insertions, 12 deletions
diff --git a/vendor/rustix/src/fs/seek_from.rs b/vendor/rustix/src/fs/seek_from.rs
index cca23ed62..c08abd2e6 100644
--- a/vendor/rustix/src/fs/seek_from.rs
+++ b/vendor/rustix/src/fs/seek_from.rs
@@ -4,9 +4,12 @@
/// Enumeration of possible methods to seek within an I/O object.
///
-/// It is used by the [`Seek`] trait.
+/// It is used by the [`seek`] function.
///
-/// [`Seek`]: std::io::Seek
+/// This is similar to [`std::io::SeekFrom`], however it adds platform-specific
+/// seek options.
+///
+/// [`seek`]: crate::fs::seek
#[derive(Copy, PartialEq, Eq, Clone, Debug)]
#[cfg_attr(staged_api, stable(feature = "rust1", since = "1.0.0"))]
pub enum SeekFrom {
@@ -30,19 +33,21 @@ pub enum SeekFrom {
#[cfg_attr(staged_api, stable(feature = "rust1", since = "1.0.0"))]
Current(#[cfg_attr(staged_api, stable(feature = "rust1", since = "1.0.0"))] i64),
- /// Sets the offset to the current position plus the specified number of bytes,
- /// plus the distance to the next byte which is not in a hole.
+ /// Sets the offset to the current position plus the specified number of
+ /// bytes, plus the distance to the next byte which is not in a hole.
///
- /// If the offset is in a hole at the end of the file, the seek will produce
- /// an `NXIO` error.
- #[cfg(any(freebsdlike, target_os = "linux", target_os = "solaris"))]
+ /// If the offset is in a hole at the end of the file, the seek will fail
+ /// with [`Errno::NXIO`].
+ ///
+ /// [`Errno::NXIO`]: crate::io::Errno::NXIO
+ #[cfg(any(apple, freebsdlike, linux_kernel, solarish))]
Data(i64),
- /// Sets the offset to the current position plus the specified number of bytes,
- /// plus the distance to the next byte which is in a hole.
+ /// Sets the offset to the current position plus the specified number of
+ /// bytes, plus the distance to the next byte which is in a hole.
///
- /// If there is no hole past the offset, it will be set to the end of the file
- /// i.e. there is an implicit hole at the end of any file.
- #[cfg(any(freebsdlike, target_os = "linux", target_os = "solaris"))]
+ /// If there is no hole past the offset, it will be set to the end of the
+ /// file i.e. there is an implicit hole at the end of any file.
+ #[cfg(any(apple, freebsdlike, linux_kernel, solarish))]
Hole(i64),
}