pub struct GlobItemsDep {
pub glob: String,
pub xvc_path_metadata_map: BTreeMap<XvcPath, XvcMetadata>,
pub xvc_path_content_digest_map: BTreeMap<XvcPath, ContentDigest>,
}
Expand description
A path collection where each item is tracked separately.
Fields§
§glob: String
The glob pattern that will be converted to a [Glob]
xvc_path_metadata_map: BTreeMap<XvcPath, XvcMetadata>
The metadata of paths that match the glob pattern
xvc_path_content_digest_map: BTreeMap<XvcPath, ContentDigest>
The content digest of paths that match the glob pattern
Implementations§
Source§impl GlobItemsDep
impl GlobItemsDep
Sourcepub fn new(glob: String) -> Self
pub fn new(glob: String) -> Self
Create a new GlobItemsDep with the given glob pattern with empty metadata and digest maps.
Sourcepub fn from_pmp(
glob_root: &XvcPath,
glob: String,
pmp: &XvcPathMetadataProvider,
) -> Result<GlobItemsDep>
pub fn from_pmp( glob_root: &XvcPath, glob: String, pmp: &XvcPathMetadataProvider, ) -> Result<GlobItemsDep>
Create a new GlobItemsDep with the given glob pattern and fill the metadata map from the given pmp. The content digest map in the returned Self is empty.
Sourcepub fn update_paths(
self,
glob_root: &XvcPath,
pmp: &XvcPathMetadataProvider,
) -> Result<Self>
pub fn update_paths( self, glob_root: &XvcPath, pmp: &XvcPathMetadataProvider, ) -> Result<Self>
Update path list by rereading the file list from disk. This doesn’t update content digests of files. Use Self::update_digests for this.
Sourcepub fn update_digests(
self,
xvc_root: &XvcRoot,
algorithm: HashAlgorithm,
) -> Result<Self>
pub fn update_digests( self, xvc_root: &XvcRoot, algorithm: HashAlgorithm, ) -> Result<Self>
Update the content digest map for each path in the metadata map. This doesn’t update the file list defined by glob. Use Self::update_paths for this.
Sourcepub fn update_changed_paths_digests(
self,
record: &Self,
xvc_root: &XvcRoot,
glob_root: &XvcPath,
pmp: &XvcPathMetadataProvider,
algorithm: HashAlgorithm,
) -> Result<Self>
pub fn update_changed_paths_digests( self, record: &Self, xvc_root: &XvcRoot, glob_root: &XvcPath, pmp: &XvcPathMetadataProvider, algorithm: HashAlgorithm, ) -> Result<Self>
Update the content digest map for each path in the metadata map. This doesn’t update the file list defined by glob. Use Self::update_paths for this.
Calculates content digests when the path metadata is different from record’s. This way only the changed path’s content digest is calculated.
Trait Implementations§
Source§impl Clone for GlobItemsDep
impl Clone for GlobItemsDep
Source§fn clone(&self) -> GlobItemsDep
fn clone(&self) -> GlobItemsDep
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for GlobItemsDep
impl Debug for GlobItemsDep
Source§impl<'de> Deserialize<'de> for GlobItemsDep
impl<'de> Deserialize<'de> for GlobItemsDep
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Diffable for GlobItemsDep
impl Diffable for GlobItemsDep
Source§fn diff_superficial(
record: &Self::Item,
actual: &Self::Item,
) -> Diff<Self::Item>
fn diff_superficial( record: &Self::Item, actual: &Self::Item, ) -> Diff<Self::Item>
Just compares the xvc_path_metadata_map field.
Source§fn diff_thorough(record: &Self::Item, actual: &Self::Item) -> Diff<Self::Item>
fn diff_thorough(record: &Self::Item, actual: &Self::Item) -> Diff<Self::Item>
Just compares the xvc_content_digest_map field.
Source§type Item = GlobItemsDep
type Item = GlobItemsDep
Source§fn diff(
record: Option<&Self::Item>,
actual: Option<&Self::Item>,
) -> Diff<Self::Item>
fn diff( record: Option<&Self::Item>, actual: Option<&Self::Item>, ) -> Diff<Self::Item>
Source§impl From<GlobItemsDep> for XvcDependency
impl From<GlobItemsDep> for XvcDependency
Source§fn from(val: GlobItemsDep) -> Self
fn from(val: GlobItemsDep) -> Self
Source§impl Ord for GlobItemsDep
impl Ord for GlobItemsDep
Source§fn cmp(&self, other: &GlobItemsDep) -> Ordering
fn cmp(&self, other: &GlobItemsDep) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for GlobItemsDep
impl PartialEq for GlobItemsDep
Source§impl PartialOrd for GlobItemsDep
impl PartialOrd for GlobItemsDep
Source§impl Serialize for GlobItemsDep
impl Serialize for GlobItemsDep
Source§impl Storable for GlobItemsDep
impl Storable for GlobItemsDep
Source§fn type_description() -> String
fn type_description() -> String
impl Eq for GlobItemsDep
impl StructuralPartialEq for GlobItemsDep
Auto Trait Implementations§
impl Freeze for GlobItemsDep
impl RefUnwindSafe for GlobItemsDep
impl Send for GlobItemsDep
impl Sync for GlobItemsDep
impl Unpin for GlobItemsDep
impl UnwindSafe for GlobItemsDep
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> Comparable<K> for Q
impl<Q, K> Comparable<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.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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 more