pub enum ObjectFilterSpec {
BlobNone,
BlobLimit(u64),
}Expand description
Client-side object filter for fetch and clone (partial clone).
Only blob:none and blob:limit=<n> are supported on the wire today; other
ObjectFilter kinds remain server-side upload-pack policy only.
Variants§
BlobNone
Omit all blob objects (blob:none).
BlobLimit(u64)
Omit blobs whose inflated size is at or above the limit (blob:limit=<n>).
Implementations§
Source§impl ObjectFilterSpec
impl ObjectFilterSpec
Sourcepub fn parse(spec: &str) -> Result<Self, PartialCloneError>
pub fn parse(spec: &str) -> Result<Self, PartialCloneError>
Parse blob:none or blob:limit=<size> (same grammar as Git --filter=).
§Errors
Returns PartialCloneError::InvalidFilter for unsupported filter kinds.
Sourcepub fn from_object_filter(
filter: &ObjectFilter,
) -> Result<Self, PartialCloneError>
pub fn from_object_filter( filter: &ObjectFilter, ) -> Result<Self, PartialCloneError>
Narrow a general ObjectFilter to a partial-clone wire spec when possible.
§Errors
Returns PartialCloneError::InvalidFilter when filter is not blob:none or blob:limit.
Sourcepub fn to_wire_spec(&self) -> String
pub fn to_wire_spec(&self) -> String
Serialize for a filter <spec> wire line (limits expanded to byte counts).
Sourcepub fn to_config_value(&self) -> String
pub fn to_config_value(&self) -> String
Value stored in remote.<name>.partialclonefilter (Git-compatible).
Sourcepub fn expand_for_protocol(&self) -> Result<String, PartialCloneError>
pub fn expand_for_protocol(&self) -> Result<String, PartialCloneError>
Expand for protocol (e.g. blob:limit=1k → blob:limit=1024).
§Errors
Returns PartialCloneError::InvalidFilter when expansion fails.
Sourcepub fn from_blobs_cli(value: &str) -> Result<Self, PartialCloneError>
pub fn from_blobs_cli(value: &str) -> Result<Self, PartialCloneError>
Parse grit clone --blobs values: none or a size with optional k/m/g suffix.
Sizes map to blob:limit=<n> (same grammar as Git --filter=blob:limit=…).
§Errors
Returns PartialCloneError::InvalidFilter when value is not none or a valid limit.
Sourcepub const fn blob_limit_bytes(&self) -> Option<u64>
pub const fn blob_limit_bytes(&self) -> Option<u64>
Byte limit when this spec is Self::BlobLimit; None for Self::BlobNone.