sel-rs 0.2.2

Select slices from text files by line numbers, ranges, positions, or regex
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Output sinks.

pub mod file;
pub mod stdout;

pub use file::FileSink;
pub use stdout::StdoutSink;

use std::io::{self, Write};

/// A sink is a buffered writer that may know whether it's a terminal.
pub trait Sink: Write {
    /// Is this sink attached to a terminal? Used for `--color=auto`.
    fn is_terminal(&self) -> bool;

    /// Finalize output — flush and surface any error.
    fn finish(self: Box<Self>) -> io::Result<()>;
}