Type Alias rustc_middle::query::queries::visibility::ProvidedValue
source · pub type ProvidedValue<'tcx> = Visibility<DefId>;
Expand description
This type alias specifies the type returned from query providers and the type
used for decoding. For regular queries this is the declared returned type V
,
but arena_cache
will use <V as Deref>::Target
instead.
Aliased Type§
enum ProvidedValue<'tcx> {
Public,
Restricted(DefId),
}
Variants§
Public
Visible everywhere (including in other crates).
Restricted(DefId)
Visible only in the given crate-local module.
Implementations§
source§impl<Id> Visibility<Id>
impl<Id> Visibility<Id>
source§impl<Id: Into<DefId>> Visibility<Id>
impl<Id: Into<DefId>> Visibility<Id>
pub fn to_def_id(self) -> Visibility<DefId>
sourcepub fn is_accessible_from(
self,
module: impl Into<DefId>,
tcx: TyCtxt<'_>
) -> bool
pub fn is_accessible_from( self, module: impl Into<DefId>, tcx: TyCtxt<'_> ) -> bool
Returns true
if an item with this visibility is accessible from the given module.
sourcepub fn is_at_least(
self,
vis: Visibility<impl Into<DefId>>,
tcx: TyCtxt<'_>
) -> bool
pub fn is_at_least( self, vis: Visibility<impl Into<DefId>>, tcx: TyCtxt<'_> ) -> bool
Returns true
if this visibility is at least as accessible as the given visibility
source§impl Visibility<DefId>
impl Visibility<DefId>
pub fn expect_local(self) -> Visibility
sourcepub fn is_visible_locally(self) -> bool
pub fn is_visible_locally(self) -> bool
Returns true
if this item is visible anywhere in the local crate.
Trait Implementations§
source§impl<Id: Clone> Clone for Visibility<Id>
impl<Id: Clone> Clone for Visibility<Id>
source§fn clone(&self) -> Visibility<Id>
fn clone(&self) -> Visibility<Id>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<Id: Debug> Debug for Visibility<Id>
impl<Id: Debug> Debug for Visibility<Id>
source§impl<Id: Hash> Hash for Visibility<Id>
impl<Id: Hash> Hash for Visibility<Id>
source§impl<'__ctx, Id> HashStable<StableHashingContext<'__ctx>> for Visibility<Id>where
Id: HashStable<StableHashingContext<'__ctx>>,
impl<'__ctx, Id> HashStable<StableHashingContext<'__ctx>> for Visibility<Id>where Id: HashStable<StableHashingContext<'__ctx>>,
fn hash_stable( &self, __hcx: &mut StableHashingContext<'__ctx>, __hasher: &mut StableHasher )
source§impl<Id: PartialEq> PartialEq<Visibility<Id>> for Visibility<Id>
impl<Id: PartialEq> PartialEq<Visibility<Id>> for Visibility<Id>
source§fn eq(&self, other: &Visibility<Id>) -> bool
fn eq(&self, other: &Visibility<Id>) -> bool
self
and other
values to be equal, and is used
by ==
.impl<Id: Copy> Copy for Visibility<Id>
impl<Id: Eq> Eq for Visibility<Id>
impl<Id> StructuralEq for Visibility<Id>
impl<Id> StructuralPartialEq for Visibility<Id>
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: 8 bytes
Size for each variant:
Public
: 0 bytesRestricted
: 8 bytes