pub enum PackVersion {
V2,
V3,
}Expand description
A packfile’s format version, as the four bytes after PACK say it.
Local, and two variants wide, because the field below is the only thing
gunnar-wire and gunnar-server ever wanted out of gix-pack — see this
module’s header for what naming it cost.
Variants§
V2
Version 2. Everything git has written by default since 2005.
V3
Version 3. Reserved by the format; git does not emit it.
Implementations§
Source§impl PackVersion
impl PackVersion
Sourcepub fn from_u32(raw: u32) -> Self
pub fn from_u32(raw: u32) -> Self
Read a version out of a pack header.
Anything that is not 3 is read as 2, which is what the pack readers in this constellation have always done: the header is attacker-supplied on a receive path, and a version this does not know is not a reason to invent a third variant that no code below can handle.
Trait Implementations§
Source§impl Clone for PackVersion
impl Clone for PackVersion
impl Copy for PackVersion
Source§impl Debug for PackVersion
impl Debug for PackVersion
Source§impl Display for PackVersion
impl Display for PackVersion
impl Eq for PackVersion
Source§impl Hash for PackVersion
impl Hash for PackVersion
Source§impl PartialEq for PackVersion
impl PartialEq for PackVersion
impl StructuralPartialEq for PackVersion
Auto Trait Implementations§
impl Freeze for PackVersion
impl RefUnwindSafe for PackVersion
impl Send for PackVersion
impl Sync for PackVersion
impl Unpin for PackVersion
impl UnsafeUnpin for PackVersion
impl UnwindSafe for PackVersion
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