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)
ZeroLen(ZeroLenFileView)
IOError(Error)
Implementations
impl Preview
[src]
impl Preview
[src]pub fn new(
path: &Path,
prefered_mode: Option<PreviewMode>,
con: &AppContext
) -> Self
[src]
path: &Path,
prefered_mode: Option<PreviewMode>,
con: &AppContext
) -> Self
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]
path: &Path,
mode: PreviewMode,
con: &AppContext
) -> Result<Self, ProgramError>
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]
&self,
path: &Path,
pattern: InputPattern,
dam: &mut Dam,
con: &AppContext
) -> Option<Self>
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]
&mut self,
w: &mut W,
screen: Screen,
panel_skin: &PanelSkin,
area: &Area,
con: &AppContext
) -> Result<(), ProgramError>
pub fn display_info(
&mut self,
w: &mut W,
screen: Screen,
panel_skin: &PanelSkin,
area: &Area
) -> Result<(), ProgramError>
[src]
&mut self,
w: &mut W,
screen: Screen,
panel_skin: &PanelSkin,
area: &Area
) -> Result<(), ProgramError>
Auto Trait Implementations
impl !RefUnwindSafe for Preview
impl !RefUnwindSafe for Preview
impl !UnwindSafe for Preview
impl !UnwindSafe for Preview