pub struct FileChange {
pub filename: String,
pub status: String,
pub additions: u32,
pub deletions: u32,
pub changes: u32,
pub blob_url: String,
pub raw_url: String,
pub contents_url: String,
pub patch: Option<String>,
pub previous_filename: Option<String>,
}Expand description
A single file change within a Comparison.
Carries per-file statistics (additions, deletions) and the unified diff patch when available.
§Examples
let cmp = client.compare_commits("owner", "repo", "v1.0.0", "v1.1.0").await?;
for file in &cmp.files {
println!("{} [{}]: +{} -{}", file.filename, file.status,
file.additions, file.deletions);
if let Some(prev) = &file.previous_filename {
println!(" (renamed from {})", prev);
}
}Fields§
§filename: StringCurrent file path in the repository.
status: StringChange status for this file.
Possible values: "added", "removed", "modified", "renamed",
"copied", "changed", "unchanged".
additions: u32Number of lines added.
deletions: u32Number of lines deleted.
changes: u32Total lines changed (additions + deletions).
blob_url: StringURL for the blob view of this file.
raw_url: StringURL for the raw file content.
contents_url: StringGitHub Contents API URL for this file.
patch: Option<String>Unified diff patch for this file.
May be None for binary files or when the diff exceeds GitHub’s size
limits.
previous_filename: Option<String>Previous file path, present only when status is "renamed" or
"copied".
Trait Implementations§
Source§impl Clone for FileChange
impl Clone for FileChange
Source§fn clone(&self) -> FileChange
fn clone(&self) -> FileChange
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FileChange
impl Debug for FileChange
Source§impl<'de> Deserialize<'de> for FileChange
impl<'de> Deserialize<'de> for FileChange
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for FileChange
impl RefUnwindSafe for FileChange
impl Send for FileChange
impl Sync for FileChange
impl Unpin for FileChange
impl UnsafeUnpin for FileChange
impl UnwindSafe for FileChange
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