Skip to main content

FsyncComponents

Struct FsyncComponents 

Source
pub struct FsyncComponents(/* private fields */);
Expand description

The set of repository parts to harden through an FsyncMethod barrier, mirroring upstream enum fsync_component (git 2.55 write-or-die.h).

Implementations§

Source§

impl FsyncComponents

Source

pub const NONE: Self

Upstream FSYNC_COMPONENT_NONE: data that is not persistent and must never be synced.

Source

pub const LOOSE_OBJECT: Self

Source

pub const PACK: Self

Source

pub const PACK_METADATA: Self

Source

pub const COMMIT_GRAPH: Self

Source

pub const INDEX: Self

Source

pub const REFERENCE: Self

Source

pub const OBJECT_MAP: Self

Source

pub const OBJECTS: Self

Upstream FSYNC_COMPONENTS_OBJECTS.

Source

pub const DERIVED_METADATA: Self

Upstream FSYNC_COMPONENTS_DERIVED_METADATA.

Source

pub const DEFAULT: Self

Upstream FSYNC_COMPONENTS_DEFAULT: everything except loose objects.

Source

pub const COMMITTED: Self

Upstream FSYNC_COMPONENTS_COMMITTED.

Source

pub const ADDED: Self

Upstream FSYNC_COMPONENTS_ADDED.

Source

pub const ALL: Self

Upstream FSYNC_COMPONENTS_ALL.

Source

pub const PLATFORM_DEFAULT: Self = Self::DEFAULT

Upstream FSYNC_COMPONENTS_PLATFORM_DEFAULT. No platform overrides it in git v2.55, so this equals Self::DEFAULT everywhere today; kept separate because git exposes the default as compile-time platform policy and parse starts from it.

Source

pub fn parse(value: &str) -> Self

Parse one core.fsync value into a component set.

Grammar (upstream parse_fsync_components): start from Self::PLATFORM_DEFAULT; none resets the running base to empty; each remaining comma-separated component is trimmed and prefix-matched against Self::COMPONENT_TABLE, accumulating into negative or positive masks by leading -; finally the result is (base & ~negative) | positive, so a component named both ways wins as positive in either order. Unknown components are ignored, and a bare - ends parsing like upstream’s warning path.

Source

pub const fn contains(self, other: Self) -> bool

Whether every bit of other is present.

Source

pub const fn union(self, other: Self) -> Self

Union with other.

Source

pub const fn without(self, other: Self) -> Self

Remove all bits of other.

Source

pub const fn bits(self) -> u32

Raw bitmask, mainly for tests and diagnostics.

Source

pub const fn includes_reference(self) -> bool

Whether reference files are included, replacing the old core_fsync_includes_reference predicate on equal terms.

Trait Implementations§

Source§

impl Clone for FsyncComponents

Source§

fn clone(&self) -> FsyncComponents

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for FsyncComponents

Source§

impl Debug for FsyncComponents

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for FsyncComponents

Source§

fn default() -> FsyncComponents

Returns the “default value” for a type. Read more
Source§

impl Eq for FsyncComponents

Source§

impl PartialEq for FsyncComponents

Source§

fn eq(&self, other: &FsyncComponents) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for FsyncComponents

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.