[][src]Trait async_std::io::prelude::SeekExt

pub trait SeekExt: Seek {
    fn seek(&mut self, pos: SeekFrom) -> SeekFuture<Self>
    where
        Self: Unpin
, { ... } }

Extension methods for Seek.

Provided methods

fn seek(&mut self, pos: SeekFrom) -> SeekFuture<Self> where
    Self: Unpin

Seeks to a new position in a byte stream.

Returns the new position in the byte stream.

A seek beyond the end of stream is allowed, but behavior is defined by the implementation.

Examples

use async_std::fs::File;
use async_std::io::SeekFrom;
use async_std::prelude::*;

let mut file = File::open("a.txt").await?;

let file_len = file.seek(SeekFrom::End(0)).await?;
Loading content...

Implementors

impl<T: Seek + ?Sized> SeekExt for T[src]

Loading content...