Struct TypeSignatureHash
pub struct TypeSignatureHash { /* private fields */ }Expand description
High-quality hash builder for type signatures using FNV-1a inspired mixing
This hash function solves the collision problems of XOR-based approaches by using sequential mixing with multiplication. Each component is mixed into the hash state in a way that preserves order and prevents self-cancellation.
Implementations§
§impl TypeSignatureHash
impl TypeSignatureHash
pub fn new() -> Self
pub fn new() -> Self
Create a new signature hash builder
Initializes with FNV-1a offset basis for good hash distribution
pub fn add_component<T: Hash + ?Sized>(self, component: &T) -> Self
pub fn add_component<T: Hash + ?Sized>(self, component: &T) -> Self
Add a hashable component to the signature
This method can hash any type that implements the Hash trait, providing
flexibility for including various type information in the signature.
§Arguments
component- Any hashable component to include in the signature
pub fn add_flavor(self, flavor: &CilFlavor) -> Self
pub fn add_flavor(self, flavor: &CilFlavor) -> Self
Add the type flavor to the signature
The flavor distinguishes fundamental type categories and prevents
collisions between types with the same name but different categories
(e.g., List class vs List<T> generic instance).
§Arguments
flavor- The CIL flavor/category of the type
pub fn add_fullname(self, namespace: &str, name: &str) -> Self
pub fn add_fullname(self, namespace: &str, name: &str) -> Self
Add the full type name (namespace + name) to the signature
§Arguments
namespace- The type’s namespace (may be empty for global types)name- The type’s name including generic arity markers (e.g., “List`1”)
pub fn add_source(self, source: &TypeSource) -> Self
pub fn add_source(self, source: &TypeSource) -> Self
Add the type source information to the signature
This distinguishes types from different assemblies, modules, or files that might otherwise have identical names and structures.
§Arguments
source- The source context where the type is defined
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TypeSignatureHash
impl RefUnwindSafe for TypeSignatureHash
impl Send for TypeSignatureHash
impl Sync for TypeSignatureHash
impl Unpin for TypeSignatureHash
impl UnsafeUnpin for TypeSignatureHash
impl UnwindSafe for TypeSignatureHash
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for T
impl<T> Downcast for T
impl<T> ErasedDestructor for Twhere
T: 'static,
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 moreSource§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.