pub struct SideBytes {
pub data: Vec<u8>,
pub encoding_lossy: bool,
pub size: u64,
}Expand description
Bytes of one file side prepared for diffing.
Fields§
§data: Vec<u8>Raw file contents.
encoding_lossy: booltrue when SideBytes::text used lossy UTF-8 decoding.
size: u64Byte length of this side; kept when Self::data is dropped for binary diffs.
Implementations§
Source§impl SideBytes
impl SideBytes
Sourcepub fn from_bytes(data: Vec<u8>) -> Self
pub fn from_bytes(data: Vec<u8>) -> Self
Decode as text for diffing (NUL in the first 8 KiB ⇒ treat as binary upstream).
Sourcepub fn empty_with_size(size: u64) -> Self
pub fn empty_with_size(size: u64) -> Self
Empty payload with a known on-disk byte length (binary stat / skipped reads).
Sourcepub fn text(&self) -> String
pub fn text(&self) -> String
Lossy UTF-8 view of Self::data.
Trait Implementations§
impl Eq for SideBytes
impl StructuralPartialEq for SideBytes
Auto Trait Implementations§
impl Freeze for SideBytes
impl RefUnwindSafe for SideBytes
impl Send for SideBytes
impl Sync for SideBytes
impl Unpin for SideBytes
impl UnsafeUnpin for SideBytes
impl UnwindSafe for SideBytes
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.