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.
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
Implementations
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.
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
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 more