type Visibility = Visibility<LocalDefId>;
Aliased Type§
enum Visibility {
Public,
Restricted(LocalDefId),
}
Variants§
Public
Visible everywhere (including in other crates).
Restricted(LocalDefId)
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: 4 bytes
Size for each variant:
Public
: 0 bytesRestricted
: 4 bytes
Implementations
Source§impl<Id> Visibility<Id>
impl<Id> Visibility<Id>
Source§impl<Id> Visibility<Id>
impl<Id> 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
impl Visibility
pub fn to_string(self, def_id: LocalDefId, tcx: TyCtxt<'_>) -> String
Trait Implementations
Source§impl<Id> Clone for Visibility<Id>where
Id: Clone,
impl<Id> Clone for Visibility<Id>where
Id: Clone,
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