20 lines
706 B
Plaintext
20 lines
706 B
Plaintext
#! @file seekable.sakura
|
|||
|
|
#! @author John Christman (sorakatadzuma@gmail.com)
|
||
|
|
#! @copyright Malunal Studios, LLC.
|
||
|
|
#! @license MIT
|
||
|
|
#!
|
||
|
|
#! Contains the seekable trait, which a stream whose position can be moved
|
||
|
|
#! implements, as a file does.
|
||
|
|
import system;
|
||
|
|
module std::io;
|
||
|
|
|
||
|
|
|
||
|
|
#! A stream whose position, where the next read or write happens, can be moved.
|
||
|
|
pub trait seekable {
|
||
|
|
#! Moves the position.
|
||
|
|
#! @param this The stream whose position to move.
|
||
|
|
#! @param offset The offset to move to.
|
||
|
|
#! @param from Where the offset is measured from.
|
||
|
|
#! @returns The new position, from the start, or why it could not be moved.
|
||
|
|
def seek(&mut this, offset: i64, from: whence): result<u64, io_error>;
|
||
|
|
}
|