Type Alias rustc_middle::query::queries::visibility::Value
source · pub type Value<'tcx> = Visibility<DefId>;
Aliased Type§
enum Value<'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>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
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
This method tests for
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