pub enum Preview {
Syntaxed(HLContent),
Text(TextContent),
Binary(BinaryContent),
Pdf(PdfContent),
Archive(ZipContent),
Ueberzug(Ueberzug),
Media(MediaContent),
Directory(Directory),
Iso(Iso),
Diff(Diff),
ColoredText(ColoredText),
Empty,
}Expand description
Different kind of preview used to display some informaitons About the file. We check if it’s an archive first, then a pdf file, an image, a media file
Variants§
Syntaxed(HLContent)
Text(TextContent)
Binary(BinaryContent)
Pdf(PdfContent)
Archive(ZipContent)
Ueberzug(Ueberzug)
Media(MediaContent)
Directory(Directory)
Iso(Iso)
Diff(Diff)
ColoredText(ColoredText)
Empty
Implementations§
source§impl Preview
impl Preview
sourcepub fn new(
file_info: &FileInfo,
users_cache: &UsersCache,
status: &Status,
colors: &Colors
) -> Result<Self>
pub fn new( file_info: &FileInfo, users_cache: &UsersCache, status: &Status, colors: &Colors ) -> Result<Self>
Creates a new preview instance based on the filekind and the extension of the file. Sometimes it reads the content of the file, sometimes it delegates it to the display method.
sourcepub fn window_for_second_pane(&self, height: usize) -> ContentWindow
pub fn window_for_second_pane(&self, height: usize) -> ContentWindow
Creates a new, static window used when we display a preview in the second pane