#[non_exhaustive]pub enum RefStorageFormat {
Files,
Reftable,
}Expand description
On-disk ref storage backend named by extensions.refStorage.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Files
Traditional loose refs under refs/ plus packed-refs.
Reftable
Git reftable backend (extensions.refStorage = reftable).
Implementations§
Source§impl RefStorageFormat
impl RefStorageFormat
Sourcepub fn parse_config_value(raw: &str) -> Result<Self>
pub fn parse_config_value(raw: &str) -> Result<Self>
Parse an extensions.refStorage config value (optional name:payload suffix).
§Errors
Returns Error::InvalidRefStorageFormat when the name is not files or reftable.
Sourcepub fn detect(git_dir: &Path) -> Result<Self>
pub fn detect(git_dir: &Path) -> Result<Self>
Detect ref storage from repository-local config (linked worktree common dir when needed).
When extensions.refStorage is absent, returns RefStorageFormat::Files.
§Errors
Propagates I/O and repository format errors when local config is invalid.
Sourcepub fn validate_config_extension(raw: &str) -> Result<()>
pub fn validate_config_extension(raw: &str) -> Result<()>
Validate an extensions.refStorage value from repository config.
§Errors
Returns Error::InvalidRefStorageFormat when the value is not recognized.
Sourcepub const fn is_reftable(self) -> bool
pub const fn is_reftable(self) -> bool
Whether this format uses the reftable backend.
Trait Implementations§
Source§impl Clone for RefStorageFormat
impl Clone for RefStorageFormat
impl Copy for RefStorageFormat
Source§impl Debug for RefStorageFormat
impl Debug for RefStorageFormat
Source§impl Default for RefStorageFormat
impl Default for RefStorageFormat
Source§impl Display for RefStorageFormat
impl Display for RefStorageFormat
impl Eq for RefStorageFormat
Source§impl FromStr for RefStorageFormat
impl FromStr for RefStorageFormat
Source§impl Hash for RefStorageFormat
impl Hash for RefStorageFormat
Source§impl PartialEq for RefStorageFormat
impl PartialEq for RefStorageFormat
impl StructuralPartialEq for RefStorageFormat
Auto Trait Implementations§
impl Freeze for RefStorageFormat
impl RefUnwindSafe for RefStorageFormat
impl Send for RefStorageFormat
impl Sync for RefStorageFormat
impl Unpin for RefStorageFormat
impl UnsafeUnpin for RefStorageFormat
impl UnwindSafe for RefStorageFormat
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