fn as_expressed_vis(&self) -> Option<Cow<syn::Visibility>> {
        let declares_public = self.public().is_present();
        let declares_private = self.private().is_present();
        let declares_explicit = self.explicit().is_some();

        if declares_private {
            assert!(!declares_public && !declares_explicit);
            Some(Cow::Owned(syn::Visibility::Inherited))
        } else if let Some(vis) = self.explicit() {
            assert!(!declares_public);
            Some(Cow::Borrowed(vis))
        } else if declares_public {
            Some(Cow::Owned(syn::parse_quote!(pub)))
        } else {
            None
        }
    }
/// Get the explicitly-expressed visibility preference from the attribute.
/// This returns `None` if the input didn't include either keyword.
///
/// # Panics
/// This method panics if the input specifies both `public` and `private`.
Get the explicitly-expressed visibility preference from the attribute.
This returns `None` if the input didn't include either keyword.
Get the explicitly - expressed visibility preference from the attribute . This returns ` None ` if the input didn ' t include either keyword .
fn as_expressed_vis(&self) -> Option<Cow<syn::Visibility>> {
        let declares_public = self.public().is_present();
        let declares_private = self.private().is_present();
        let declares_explicit = self.explicit().is_some();
        if declares_private {
            assert!(!declares_public && !declares_explicit);
            Some(Cow::Owned(syn::Visibility::Inherited))
        } else if let Some(vis) = self.explicit() {
            assert!(!declares_public);
            Some(Cow::Borrowed(vis))
        } else if declares_public {
            Some(Cow::Owned(syn::parse_quote!(pub)))
        } else {
            None
        }
    }
fn as_expressed_vis ( & self ) -> Option < Cow < syn :: Visibility > > { let declares_public = self . public ( ) . is_present ( ) ; let declares_private = self . private ( ) . is_present ( ) ; let declares_explicit = self . explicit ( ) . is_some ( ) ; if declares_private { assert ! ( declares_public declares_explicit ) ; Some ( Cow :: Owned ( syn :: Visibility :: Inherited ) ) } else if let Some ( vis ) = self . explicit ( ) { assert ! ( declares_public ) ; Some ( Cow :: Borrowed ( vis ) ) } else if declares_public { Some ( Cow :: Owned ( syn :: parse_quote ! ( pub ) ) ) } else { None } }
Get the explicitly-expressed visibility preference from the attribute.
Get the explicitly - expressed visibility preference from the attribute .
&self
&self
panics
This method panics if the input specifies both `public` and `private`.
This method panics if the input specifies both ` public ` and ` private ` .