pub enum Preview {
    Image(ImageView),
    Syntactic(SyntacticView),
    Hex(HexView),
    ZeroLen(ZeroLenFileView),
    IoError(Error),
}

Variants

Image(ImageView)

Syntactic(SyntacticView)

Hex(HexView)

ZeroLen(ZeroLenFileView)

IoError(Error)

Implementations

build a preview, never failing (but the preview can be Preview::IOError). If the prefered mode can’t be applied, an other mode is chosen.

try to build a preview with the designed mode, return an error if that wasn’t possible

build an image view, unless the file can’t be interpreted as an image, in which case a hex view is used

build a text preview (maybe with syntaxic coloring) if possible, a hex (binary) view if content isnt’t UTF8, a ZeroLen file if there’s no length (it’s probably a linux pseudofile) or a IOError when there’s a IO problem

build a text preview with no syntax highlighting, if possible

try to build a filtered text view. Will return None if the dam gets an event before it’s built

return a hex_view, suitable for binary, or Self::IOError if there was an error

return the preview_mode, or None if we’re on IOError

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.

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 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.