Enum fm::preview::Preview

source ·
pub enum Preview {
    Syntaxed(HLContent),
    Text(TextContent),
    Binary(BinaryContent),
    Pdf(PdfContent),
    Archive(ZipContent),
    Exif(ExifContent),
    Thumbnail(Pixels),
    Media(MediaContent),
    Directory(Directory),
    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)

§

Exif(ExifContent)

§

Thumbnail(Pixels)

§

Media(MediaContent)

§

Directory(Directory)

§

Empty

Implementations§

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.

Creates a thumbnail preview of the file.

Creates the help preview as if it was a text file.

Empty preview, holding nothing.

The size (most of the time the number of lines) of the preview. Some preview (thumbnail, empty) can’t be scrolled and their size is always 0.

True if nothing is currently previewed.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more