Skip to content

Enum std::io::SeekFrom

列举可能在 I/O 对象中进行搜索的方法。

rust
pub enum SeekFrom {
    Start(u64),
    End(i64),
    Current(i64),
}

SeekFrom实现了Seek Trait

Variants

Start(u64)

将偏移量设置为提供的字节数。

从第 n 个字节开始

End(i64)

将偏移量设置为此对象的大小加上指定的字节数。

可以在 object 的末尾之外进行 seek,但在字节之前进行 seek 是错误的 0.

从文件末尾 ± n

Current(i64)

将偏移量设置为当前位置加上指定的字节数。

可以在 object 的末尾之外进行 seek,但在字节之前进行 seek 是错误的 0.

从当前位置 ± n

Trait Implementations

impl Clone for SeekFrom

clone

返回值的副本。

rust
fn clone(&self) -> SeekFrom

clone_from

从 source执行复制分配。

rust
 fn clone_from(&mut self, source : &Self)

impl Debug for SeekFrom

fmt

使用给定的格式化程序格式化该值。

rust
fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl PartialEq<SeekFrom> for SeekFrom

eq

此方法测试 self 和 other 值是否相等,并由 == 使用。

rust
fn eq(&self, other: &SeekFrom) -> bool

ne

此方法测试 !=。 默认实现几乎总是足够的,并且不应在没有充分理由的情况下被覆盖。

rust
fn ne(&self, other: &Rhs) -> bool

impl Copy for SeekFrom

impl Eq for SeekFrom

impl StructuralEq for SeekFrom

impl StructuralPartialEq for SeekFrom

Auto Trait Implementations

impl RefUnwindSafe for SeekFrom

impl Send for SeekFrom

impl Sync for SeekFrom

impl Unpin for SeekFrom

impl UnwindSafe for SeekFrom

Blanket Implementations

impl<T> Any for T

rust
impl<T> Any for T
where
  T: 'static + ?Sized,

impl<T> Borrow<T> for T

rust
impl<T> Borrow<T> for T
where
  T: ?Sized,

impl<T> BorrowMut<T> for T

rust
impl<T> BorrowMut<T> for T
where
  T: ?Sized,

impl<T> From<T> for T

impl<T, U> Into<U> for T

rust
impl<T, U> Into<U> for T
where
  U: From<T>,

impl<T> ToOwned for T

rust
impl<T> ToOwned for T
where
  T: Clone,

impl<T, U> TryFrom<U> for T

rust
impl<T, U> TryFrom<U> for T
where
  U: Into<T>,

impl<T, U> TryInto<U> for T

rust
impl<T, U> TryInto<U> for T
where
  U: TryFrom<T>,

MIT Licensed