pub struct PathHash(pub u64);Expand description
Represents a unique identifier for a path within the archive.
This ID type is a wrapper around a 64-bit unsigned integer and is used to distinguish and manage paths in a high-performance manner.
As paths within the archive might be nested and represented hierarchically, having a unique ID facilitates efficient operations such as lookup, comparison, and storage.
Tuple Fields§
§0: u64Implementations§
source§impl PathHash
impl PathHash
sourcepub fn new<'a>(paths: impl IntoIterator<Item = &'a str>) -> Self
pub fn new<'a>(paths: impl IntoIterator<Item = &'a str>) -> Self
Creates a new PathHash by hashing a sequence of path strings.
This function takes an iterable of path strings and sequentially hashes each string to
produce a unique identifier in the form of PathHash. To ensure uniqueness and avoid
collisions between consecutive paths, a delimiter (\x03\x00) is written between each
hashed string.
Arguments
paths- An iterable of path strings that need to be hashed together to produce thePathHash.
Returns
- A new
PathHashwhich represents the hashed value of the concatenated path strings.
Example
let path_hash = config_it::shared::PathHash::new(["path1", "path2", "path3"]);Trait Implementations§
source§impl<'de> Deserialize<'de> for PathHash
impl<'de> Deserialize<'de> for PathHash
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>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Ord for PathHash
impl Ord for PathHash
source§impl PartialEq<PathHash> for PathHash
impl PartialEq<PathHash> for PathHash
source§impl PartialOrd<PathHash> for PathHash
impl PartialOrd<PathHash> for PathHash
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moreimpl Copy for PathHash
impl Eq for PathHash
impl StructuralEq for PathHash
impl StructuralPartialEq for PathHash
Auto Trait Implementations§
impl RefUnwindSafe for PathHash
impl Send for PathHash
impl Sync for PathHash
impl Unpin for PathHash
impl UnwindSafe for PathHash
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
source§impl<T> Entity for Twhere
T: Send + Sync + Any + Serialize + DeserializeOwned + Clone + 'static,
impl<T> Entity for Twhere T: Send + Sync + Any + Serialize + DeserializeOwned + Clone + 'static,
fn as_any(&self) -> &(dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn deserialize(&mut self, de: &mut dyn Deserializer<'_>) -> Result<(), Error>
fn as_serialize(&self) -> &dyn Serialize
fn duplicated(&self) -> Arc<dyn Entity, Global>
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> Serialize for Twhere
T: Serialize + ?Sized,
impl<T> Serialize for Twhere T: Serialize + ?Sized,
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<Ok, Error>
source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere T: Display,
source§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read more