pub struct App {
pub running: bool,
pub current_view: View,
pub view_state: ViewState,
pub client: Option<BitbucketClient>,
pub workspace: Option<String>,
pub status: Option<String>,
pub loading: bool,
pub error: Option<String>,
pub repositories: Vec<Repository>,
pub pull_requests: Vec<PullRequest>,
pub issues: Vec<Issue>,
pub pipelines: Vec<Pipeline>,
}Expand description
Application state
Fields§
§running: boolIs the application running
current_view: ViewCurrent view
view_state: ViewStateView-specific state
client: Option<BitbucketClient>API client
workspace: Option<String>Current workspace
status: Option<String>Status message
loading: boolIs loading data
error: Option<String>Error message
repositories: Vec<Repository>§pull_requests: Vec<PullRequest>§issues: Vec<Issue>§pipelines: Vec<Pipeline>Implementations§
Source§impl App
impl App
pub fn new() -> Self
Sourcepub fn with_client(self, client: BitbucketClient) -> Self
pub fn with_client(self, client: BitbucketClient) -> Self
Initialize the application with API client
Sourcepub fn with_workspace(self, workspace: String) -> Self
pub fn with_workspace(self, workspace: String) -> Self
Set the workspace
Sourcepub fn set_status(&mut self, message: &str)
pub fn set_status(&mut self, message: &str)
Set status message
Sourcepub fn clear_status(&mut self)
pub fn clear_status(&mut self)
Clear status message
Sourcepub fn clear_error(&mut self)
pub fn clear_error(&mut self)
Clear error
Sourcepub fn switch_view(&mut self, view: View)
pub fn switch_view(&mut self, view: View)
Switch to a different view
Sourcepub fn handle_key(&mut self, key: KeyEvent)
pub fn handle_key(&mut self, key: KeyEvent)
Handle keyboard input
Sourcepub async fn load_repositories(&mut self) -> Result<()>
pub async fn load_repositories(&mut self) -> Result<()>
Load repositories
Sourcepub async fn load_pull_requests(&mut self) -> Result<()>
pub async fn load_pull_requests(&mut self) -> Result<()>
Load pull requests for the current workspace
Sourcepub async fn load_issues(&mut self) -> Result<()>
pub async fn load_issues(&mut self) -> Result<()>
Load issues for the current workspace
Sourcepub async fn load_pipelines(&mut self) -> Result<()>
pub async fn load_pipelines(&mut self) -> Result<()>
Load pipelines for the current workspace
Sourcepub async fn load_all_data(&mut self) -> Result<()>
pub async fn load_all_data(&mut self) -> Result<()>
Load all data
Trait Implementations§
Auto Trait Implementations§
impl Freeze for App
impl !RefUnwindSafe for App
impl Send for App
impl Sync for App
impl Unpin for App
impl !UnwindSafe for App
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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