20 lines
668 B
Plaintext
20 lines
668 B
Plaintext
#! @file flushable.sakura
|
|||
|
|
#! @author John Christman (sorakatadzuma@gmail.com)
|
||
|
|
#! @copyright Malunal Studios, LLC.
|
||
|
|
#! @license MIT
|
||
|
|
#!
|
||
|
|
#! Contains the flushable trait, which a stream holding bytes back implements.
|
||
|
|
import system;
|
||
|
|
module std::io;
|
||
|
|
|
||
|
|
|
||
|
|
#! A stream that holds back what it is given, and passes it on when flushed.
|
||
|
|
#!
|
||
|
|
#! Only what holds bytes back is flushable: a string, or a file, passes on what
|
||
|
|
#! it is given at once, and has nothing to flush.
|
||
|
|
pub trait flushable {
|
||
|
|
#! Passes on everything held.
|
||
|
|
#! @param this The stream to flush.
|
||
|
|
#! @returns Why it could not all be passed on, where it could not.
|
||
|
|
def flush(&mut this): result<void, io_error>;
|
||
|
|
}
|