Enum broot::preview::Preview [−][src]
Variants
Image(ImageView)
Syntactic(SyntacticView)
Hex(HexView)
ZeroLen(ZeroLenFileView)
IOError(Error)
Implementations
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 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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,