Struct rustc_span::SourceFileHash
source · [−]pub struct SourceFileHash {
pub kind: SourceFileHashAlgorithm,
pub(crate) value: [u8; 32],
}Expand description
The hash of the on-disk source file used for debug info.
Fields
kind: SourceFileHashAlgorithmvalue: [u8; 32]Implementations
sourceimpl SourceFileHash
impl SourceFileHash
pub fn new(kind: SourceFileHashAlgorithm, src: &str) -> SourceFileHash
sourcepub fn matches(&self, src: &str) -> bool
pub fn matches(&self, src: &str) -> bool
Check if the stored hash matches the hash of the string.
sourcepub fn hash_bytes(&self) -> &[u8]ⓘNotable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
pub fn hash_bytes(&self) -> &[u8]ⓘNotable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
The bytes of the hash.
pub(crate) fn hash_len(&self) -> usize
Trait Implementations
sourceimpl Clone for SourceFileHash
impl Clone for SourceFileHash
sourcefn clone(&self) -> SourceFileHash
fn clone(&self) -> SourceFileHash
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for SourceFileHash
impl Debug for SourceFileHash
sourceimpl<__D: Decoder> Decodable<__D> for SourceFileHash
impl<__D: Decoder> Decodable<__D> for SourceFileHash
sourceimpl<__E: Encoder> Encodable<__E> for SourceFileHash
impl<__E: Encoder> Encodable<__E> for SourceFileHash
sourceimpl<__CTX> HashStable<__CTX> for SourceFileHash where
__CTX: HashStableContext,
impl<__CTX> HashStable<__CTX> for SourceFileHash where
__CTX: HashStableContext,
fn hash_stable(&self, __hcx: &mut __CTX, __hasher: &mut StableHasher)
sourceimpl PartialEq<SourceFileHash> for SourceFileHash
impl PartialEq<SourceFileHash> for SourceFileHash
sourcefn eq(&self, other: &SourceFileHash) -> bool
fn eq(&self, other: &SourceFileHash) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &SourceFileHash) -> bool
fn ne(&self, other: &SourceFileHash) -> bool
This method tests for !=.
impl Copy for SourceFileHash
impl Eq for SourceFileHash
impl StructuralEq for SourceFileHash
impl StructuralPartialEq for SourceFileHash
Auto Trait Implementations
impl RefUnwindSafe for SourceFileHash
impl Send for SourceFileHash
impl Sync for SourceFileHash
impl Unpin for SourceFileHash
impl UnwindSafe for SourceFileHash
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more
Layout
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.
Size: 33 bytes