mirror of
https://github.com/gitui-org/gitui
synced 2026-05-24 09:28:21 +00:00
79 lines
1.7 KiB
Rust
79 lines
1.7 KiB
Rust
//! asyncgit
|
|
|
|
#![forbid(missing_docs)]
|
|
#![deny(unsafe_code)]
|
|
#![deny(unused_imports)]
|
|
#![deny(unused_must_use)]
|
|
#![deny(clippy::all)]
|
|
#![deny(clippy::unwrap_used)]
|
|
#![deny(clippy::panic)]
|
|
#![deny(clippy::perf)]
|
|
//TODO: get this in someday since expect still leads us to crashes sometimes
|
|
// #![deny(clippy::expect_used)]
|
|
|
|
pub mod cached;
|
|
mod commit_files;
|
|
mod diff;
|
|
mod error;
|
|
mod fetch;
|
|
mod progress;
|
|
mod push;
|
|
mod push_tags;
|
|
pub mod remote_progress;
|
|
mod revlog;
|
|
mod status;
|
|
pub mod sync;
|
|
mod tags;
|
|
|
|
pub use crate::{
|
|
commit_files::AsyncCommitFiles,
|
|
diff::{AsyncDiff, DiffParams, DiffType},
|
|
fetch::{AsyncFetch, FetchRequest},
|
|
push::{AsyncPush, PushRequest},
|
|
push_tags::{AsyncPushTags, PushTagsRequest},
|
|
remote_progress::{RemoteProgress, RemoteProgressState},
|
|
revlog::{AsyncLog, FetchStatus},
|
|
status::{AsyncStatus, StatusParams},
|
|
sync::{
|
|
diff::{DiffLine, DiffLineType, FileDiff},
|
|
status::{StatusItem, StatusItemType},
|
|
},
|
|
tags::AsyncTags,
|
|
};
|
|
use std::{
|
|
collections::hash_map::DefaultHasher,
|
|
hash::{Hash, Hasher},
|
|
};
|
|
|
|
/// this type is used to communicate events back through the channel
|
|
#[derive(Copy, Clone, Debug, PartialEq)]
|
|
pub enum AsyncNotification {
|
|
/// this indicates that no new state was fetched but that a async process finished
|
|
FinishUnchanged,
|
|
///
|
|
Status,
|
|
///
|
|
Diff,
|
|
///
|
|
Log,
|
|
///
|
|
CommitFiles,
|
|
///
|
|
Tags,
|
|
///
|
|
Push,
|
|
///
|
|
PushTags,
|
|
///
|
|
Fetch,
|
|
}
|
|
|
|
/// current working director `./`
|
|
pub static CWD: &str = "./";
|
|
|
|
/// helper function to calculate the hash of an arbitrary type that implements the `Hash` trait
|
|
pub fn hash<T: Hash + ?Sized>(v: &T) -> u64 {
|
|
let mut hasher = DefaultHasher::new();
|
|
v.hash(&mut hasher);
|
|
hasher.finish()
|
|
}
|