• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //! The following is derived from Rust's
2 //! library/std/src/io/mod.rs at revision
3 //! dca3f1b786efd27be3b325ed1e01e247aa589c3b.
4 
5 /// Enumeration of possible methods to seek within an I/O object.
6 ///
7 /// It is used by the [`Seek`] trait.
8 #[derive(Copy, PartialEq, Eq, Clone, Debug)]
9 #[cfg_attr(staged_api, stable(feature = "rust1", since = "1.0.0"))]
10 pub enum SeekFrom {
11     /// Sets the offset to the provided number of bytes.
12     #[cfg_attr(staged_api, stable(feature = "rust1", since = "1.0.0"))]
13     Start(#[cfg_attr(staged_api, stable(feature = "rust1", since = "1.0.0"))] u64),
14 
15     /// Sets the offset to the size of this object plus the specified number of
16     /// bytes.
17     ///
18     /// It is possible to seek beyond the end of an object, but it's an error
19     /// to seek before byte 0.
20     #[cfg_attr(staged_api, stable(feature = "rust1", since = "1.0.0"))]
21     End(#[cfg_attr(staged_api, stable(feature = "rust1", since = "1.0.0"))] i64),
22 
23     /// Sets the offset to the current position plus the specified number of
24     /// bytes.
25     ///
26     /// It is possible to seek beyond the end of an object, but it's an error
27     /// to seek before byte 0.
28     #[cfg_attr(staged_api, stable(feature = "rust1", since = "1.0.0"))]
29     Current(#[cfg_attr(staged_api, stable(feature = "rust1", since = "1.0.0"))] i64),
30 }
31