pub struct State {Show 14 fields
pub server: String,
pub connection: Connection,
pub listing: Listing,
pub rows: Vec<Row>,
pub next: Option<String>,
pub selected: usize,
pub view: View,
pub behind_help: View,
pub detail: Option<String>,
pub more: bool,
pub as_of: Option<OffsetDateTime>,
pub notice: Option<String>,
pub size: (u16, u16),
pub quit: bool,
}Expand description
Everything the UI shows. It never holds the token.
Fields§
§server: StringThe server’s address, as the client file gives it.
connection: ConnectionWhether the server has answered for the key.
listing: ListingThe state of the list.
rows: Vec<Row>The vCons read so far, newest first.
next: Option<String>The cursor of the next page, if there is one.
selected: usizeThe selected row’s index in rows.
view: ViewThe view drawn.
behind_help: ViewThe view help was opened from.
detail: Option<String>The uuid the detail view shows.
more: boolWhether a next page is in flight.
as_of: Option<OffsetDateTime>When the rows were last read from the server.
notice: Option<String>What went wrong with the last request, when the list is still shown.
size: (u16, u16)The terminal’s columns and lines.
quit: boolWhether the program should end.
Implementations§
Source§impl State
impl State
Sourcepub fn new(server: &str, size: (u16, u16)) -> (Self, Vec<Effect>)
pub fn new(server: &str, size: (u16, u16)) -> (Self, Vec<Effect>)
The state at start for the server at server in a terminal of
size columns and lines, and the first request.
Sourcepub fn list_rows(lines: u16) -> u16
pub fn list_rows(lines: u16) -> u16
The rows of the list a terminal of lines lines shows: at least 1.
Sourcepub fn detail_row(&self) -> Option<&Row>
pub fn detail_row(&self) -> Option<&Row>
The row the detail view shows, if the list still holds it.
Trait Implementations§
impl Eq for State
impl StructuralPartialEq for State
Auto Trait Implementations§
impl Forget for State
impl Freeze for State
impl Move for State
impl RefUnwindSafe for State
impl Send for State
impl Sync for State
impl Unpin for State
impl UnsafeUnpin for State
impl UnwindSafe for State
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more