cursive-image 0.0.6

Image view for the Cursive TUI library
Documentation
use std::io;

//
// ImageStream
//

/// Image stream.
pub trait ImageStream {
    /// Open stream.
    ///
    /// Return a reader and whether the stream is compressed.
    fn open(&self) -> io::Result<(Box<dyn io::Read>, bool)>;

    /// Into reference.
    fn into_ref(self) -> ImageStreamRef
    where
        Self: 'static + Sized + Send + Sync,
    {
        Box::new(self)
    }
}

/// Common reference type for [ImageStream].
pub type ImageStreamRef = Box<dyn ImageStream + Send + Sync>;