pub struct ContentWindow {
    pub top: usize,
    pub bottom: usize,
    pub len: usize,
    pub height: usize,
}
Expand description

Holds the information about the displayed window of lines. When there’s too much lines to display in one screen, we can scroll and this struct is responsible for that. Scrolling is done with scroll_to, scroll_up_one, scroll_down_one methods.

Fields§

§top: usize

The index of the first displayed file.

§bottom: usize

The index of the last displayed file.

§len: usize

The number of displayble file in the current folder.

§height: usize

The height of the terminal.

Implementations§

Returns a new ContentWindow instance with values depending of number of files and height of the terminal screen.

The space of the top element

How many rows are reserved at bottom Set the height of file window.

Move the window one line up if possible. Does nothing if the index can’t be reached.

Move the window one line down if possible. Does nothing if the index can’t be reached.

Reset the window to the first files of the current directory.

Scroll the window to this index if possible. Does nothing if the index can’t be reached.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

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.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

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 resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. 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.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more