pub struct Resource<'a> {
pub driver_index: Option<usize>,
pub data: Data<'a>,
pub mode: EntryKind,
pub rela_path: &'a BStr,
pub id: &'a oid,
}blob only.Expand description
A resource ready to be diffed in one way or another.
Fields§
§driver_index: Option<usize>If available, an index into the drivers field to access more diff-related information of the driver for items
at the given path, as previously determined by git-attributes.
Note that drivers are queried even if there is no object available.
data: Data<'a>The data itself, suitable for diffing, and if the object or worktree item is present at all.
mode: EntryKindThe kind of the resource we are looking at. Only possible values are Blob, BlobExecutable and Link.
rela_path: &'a BStrThe location of the resource, relative to the working tree.
id: &'a oidThe id of the content as it would be stored in git, or null if the content doesn’t exist anymore at
rela_path or if it was never computed. This can happen with content read from the worktree, which has to
go through a filter to be converted back to what git would store.
Implementations§
source§impl<'a> Resource<'a>
impl<'a> Resource<'a>
sourcepub fn intern_source(&self) -> ByteLines<'a, true> ⓘ
pub fn intern_source(&self) -> ByteLines<'a, true> ⓘ
Produce an iterator over lines, separated by LF or CRLF, suitable to create tokens using
imara_diff::intern::InternedInput.
Trait Implementations§
source§impl<'a> Ord for Resource<'a>
impl<'a> Ord for Resource<'a>
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl<'a> PartialEq for Resource<'a>
impl<'a> PartialEq for Resource<'a>
source§impl<'a> PartialOrd for Resource<'a>
impl<'a> PartialOrd for Resource<'a>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self and other) and is used by the <=
operator. Read more