pub struct FluxId<Id> {
parent: Id,
name: Symbol,
}Expand description
An id for a Flux-specific item that doesn’t have a corresponding Rust item and thus, we cannot
identify it with a DefId. This includes, for example, associated refinements, qualifiers
and refinement functions.
§Type-level invariant
This struct maintains a type-level invariant ensuring that the referenced item exists. The id is composed of two parts:
parent: A reference to a parent Rust itemname: A name uniquely identifiying the item within the parent
Since the name can be an arbitrary Symbol, this doesn’t guarantee the existence of the item,
so we must be careful when creating instances of this struct.
§Implementation Details
- Fields are private to ensure construction only through
FluxId::new - A clippy lint prevents direct usage of
FluxId::new, which can be selectively disabled when item existence is guaranteed - The type is parametric over the parent
Idtype to support various id types (e.g.,DefId,MaybeExternId)
Fields§
§parent: Id§name: SymbolImplementations§
Source§impl FluxId<DefId>
impl FluxId<DefId>
pub fn as_local(self) -> Option<FluxLocalDefId>
pub fn expect_local(self) -> FluxLocalDefId
pub fn krate(self) -> CrateNum
pub fn index(self) -> FluxId<DefIndex>
Source§impl FluxId<LocalDefId>
impl FluxId<LocalDefId>
Source§impl FluxId<MaybeExternId>
impl FluxId<MaybeExternId>
pub fn local_id(self) -> FluxLocalDefId
Trait Implementations§
Source§impl IntoQueryParam<FluxId<DefId>> for FluxLocalDefId
impl IntoQueryParam<FluxId<DefId>> for FluxLocalDefId
fn into_query_param(self) -> FluxDefId
impl<Id: Copy> Copy for FluxId<Id>
impl<Id: Eq> Eq for FluxId<Id>
impl<Id> StructuralPartialEq for FluxId<Id>
Auto Trait Implementations§
impl<Id> Freeze for FluxId<Id>where
Id: Freeze,
impl<Id> RefUnwindSafe for FluxId<Id>where
Id: RefUnwindSafe,
impl<Id> Send for FluxId<Id>where
Id: Send,
impl<Id> Sync for FluxId<Id>where
Id: Sync,
impl<Id> Unpin for FluxId<Id>where
Id: Unpin,
impl<Id> UnwindSafe for FluxId<Id>where
Id: UnwindSafe,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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