pub struct Flags {
pub assume_valid: bool,
pub extended: bool,
pub stage: u8,
pub name_length: u16,
pub skip_worktree: bool,
pub intent_to_add: bool,
}Expand description
16 bits
skip_worktree and intent_to_add live in the on-disk extended flags
word (index v3, CE_EXTENDED); extended records whether that second word
is present. The reader fills all three; the writer derives the on-disk
CE_EXTENDED bit from the extended word (or an explicit extended).
Fields§
§assume_valid: bool§extended: bool§stage: u8§name_length: u16§skip_worktree: boolCE_SKIP_WORKTREE (extended flags bit 0x4000).
intent_to_add: boolCE_INTENT_TO_ADD (extended flags bit 0x2000).
Implementations§
Source§impl Flags
impl Flags
Sourcepub const EXTENDED_FLAG_SKIP_WORKTREE: u16 = 0x4000
pub const EXTENDED_FLAG_SKIP_WORKTREE: u16 = 0x4000
The on-disk extended flag CE_SKIP_WORKTREE.
Sourcepub const EXTENDED_FLAG_INTENT_TO_ADD: u16 = 0x2000
pub const EXTENDED_FLAG_INTENT_TO_ADD: u16 = 0x2000
The on-disk extended flag CE_INTENT_TO_ADD.
Sourcepub fn new(name_len: u16) -> Self
pub fn new(name_len: u16) -> Self
Flags for an ordinary stage-0 entry.
assume_valid (CE_VALID, Git’s assume-unchanged bit) is false: Git only
sets it on an explicit update-index --assume-unchanged (or core.ignorestat),
and a reader that sees it skips the worktree stat, hiding later edits and
deletions. Callers that want the bit must set it explicitly.
Sourcepub fn from_extended_word(word: u16) -> Result<(bool, bool), GitError>
pub fn from_extended_word(word: u16) -> Result<(bool, bool), GitError>
Decode the 16-bit extended flags word, failing closed on unknown bits.
Sourcepub fn extended_word(&self) -> Option<u16>
pub fn extended_word(&self) -> Option<u16>
The extended flags word to write, or None when no extended bit is set.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Flags
impl RefUnwindSafe for Flags
impl Send for Flags
impl Sync for Flags
impl Unpin for Flags
impl UnsafeUnpin for Flags
impl UnwindSafe for Flags
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.