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: EntryKind
The kind of the resource we are looking at. Only possible values are Blob
, BlobExecutable
and Link
.
rela_path: &'a BStr
The location of the resource, relative to the working tree.
id: &'a oid
The 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 moreimpl<'a> Copy for Resource<'a>
impl<'a> Eq for Resource<'a>
impl<'a> StructuralPartialEq for Resource<'a>
Auto Trait Implementations§
impl<'a> Freeze for Resource<'a>
impl<'a> RefUnwindSafe for Resource<'a>
impl<'a> Send for Resource<'a>
impl<'a> Sync for Resource<'a>
impl<'a> Unpin for Resource<'a>
impl<'a> UnwindSafe for Resource<'a>
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)