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

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

Variants

Image(ImageView)
Syntactic(SyntacticView)
Hex(HexView)
IOError(Error)

Implementations

impl Preview[src]

pub fn new(
    path: &Path,
    prefered_mode: Option<PreviewMode>,
    con: &AppContext
) -> Self
[src]

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.

pub fn with_mode(
    path: &Path,
    mode: PreviewMode,
    con: &AppContext
) -> Result<Self, ProgramError>
[src]

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

pub fn image(path: &Path) -> Self[src]

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

pub fn unfiltered_text(path: &Path, con: &AppContext) -> Self[src]

build a text preview (maybe with syntaxic coloring) if possible, a hex (binary) view if content isnt’t UTF8, or a IOError when there’s a IO problem

pub fn filtered(
    &self,
    path: &Path,
    pattern: InputPattern,
    dam: &mut Dam,
    con: &AppContext
) -> Option<Self>
[src]

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

pub fn hex(path: &Path) -> Self[src]

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

pub fn get_mode(&self) -> Option<PreviewMode>[src]

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

pub fn pattern(&self) -> InputPattern[src]

pub fn try_scroll(&mut self, cmd: ScrollCommand) -> bool[src]

pub fn is_filterable(&self) -> bool[src]

pub fn get_selected_line(&self) -> Option<String>[src]

pub fn get_selected_line_number(&self) -> Option<LineNumber>[src]

pub fn try_select_line_number(&mut self, number: usize) -> bool[src]

pub fn unselect(&mut self)[src]

pub fn try_select_y(&mut self, y: u16) -> bool[src]

pub fn move_selection(&mut self, dy: i32, cycle: bool)[src]

pub fn select_first(&mut self)[src]

pub fn select_last(&mut self)[src]

pub fn display(
    &mut self,
    w: &mut W,
    screen: Screen,
    panel_skin: &PanelSkin,
    area: &Area,
    con: &AppContext
) -> Result<(), ProgramError>
[src]

pub fn display_info(
    &mut self,
    w: &mut W,
    screen: Screen,
    panel_skin: &PanelSkin,
    area: &Area
) -> Result<(), ProgramError>
[src]

Auto Trait Implementations

impl !RefUnwindSafe for Preview

impl Send for Preview

impl Sync for Preview

impl Unpin for Preview

impl !UnwindSafe for Preview

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,