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.
Trait Implementations§
Source§impl Clone for ObjectFilterSpec
impl Clone for ObjectFilterSpec
impl Copy for ObjectFilterSpec
Source§impl Debug for ObjectFilterSpec
impl Debug for ObjectFilterSpec
impl Eq for ObjectFilterSpec
Source§impl PartialEq for ObjectFilterSpec
impl PartialEq for ObjectFilterSpec
impl StructuralPartialEq for ObjectFilterSpec
Auto Trait Implementations§
impl Freeze for ObjectFilterSpec
impl RefUnwindSafe for ObjectFilterSpec
impl Send for ObjectFilterSpec
impl Sync for ObjectFilterSpec
impl Unpin for ObjectFilterSpec
impl UnsafeUnpin for ObjectFilterSpec
impl UnwindSafe for ObjectFilterSpec
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.