Enum broot::preview::Preview[][src]

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

Variants

Image(ImageView)

Tuple Fields of Image

0: ImageView
Syntactic(SyntacticView)

Tuple Fields of Syntactic

0: SyntacticView
Hex(HexView)

Tuple Fields of Hex

0: HexView

Tuple Fields of ZeroLen

0: ZeroLenFileView
IoError(Error)

Tuple Fields of IoError

0: 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

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

Performs the conversion.

Performs the conversion.

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.