pub struct ModuleKey(/* private fields */);Expand description
The key of one parse result: a 128-bit SipHash-1-3 of the schema, the crate version, the parser, the parse
options, the file name and the text. The directory is not part of it, so identical files share an entry and a
moved checkout keeps its cache.
Implementations§
Source§impl ModuleKey
impl ModuleKey
Sourcepub fn new(path: &Path, source: &str, options: &ParseOptions) -> Self
pub fn new(path: &Path, source: &str, options: &ParseOptions) -> Self
The key for parsing source, the text of path, with options.
Sourcepub const fn to_bytes(self) -> [u8; 16]
pub const fn to_bytes(self) -> [u8; 16]
The key as 16 little-endian bytes, for a host that persists it.
Sourcepub const fn from_bytes(bytes: [u8; 16]) -> Self
pub const fn from_bytes(bytes: [u8; 16]) -> Self
A key from the bytes ModuleKey::to_bytes gave.
Trait Implementations§
impl Copy for ModuleKey
impl Eq for ModuleKey
Source§impl Ord for ModuleKey
impl Ord for ModuleKey
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for ModuleKey
impl PartialOrd for ModuleKey
impl StructuralPartialEq for ModuleKey
Auto Trait Implementations§
impl Forget for ModuleKey
impl Freeze for ModuleKey
impl Move for ModuleKey
impl RefUnwindSafe for ModuleKey
impl Send for ModuleKey
impl Sync for ModuleKey
impl Unpin for ModuleKey
impl UnsafeUnpin for ModuleKey
impl UnwindSafe for ModuleKey
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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§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
Compare self to
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
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> ⓘ
Converts
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> ⓘ
Converts
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