pub struct AttrInfo {
pub attributes: Vec<Attribute>,
pub inline: Option<InlineAttr>,
pub rename: Option<String>,
pub public: bool,
}
Expand description
Information about the attributes and visibility of an item, field or variant..
Fields§
§attributes: Vec<Attribute>
Attributes (#[...]
).
inline: Option<InlineAttr>
Inline hints (on functions only).
rename: Option<String>
The name computed from charon::rename
and charon::variants_prefix
attributes, if any.
This provides a custom name that can be used by consumers of llbc. E.g. Aeneas uses this to
rename definitions in the extracted code.
public: bool
Whether this item is declared public. Impl blocks and closures don’t have visibility
modifiers; we arbitrarily set this to false
for them.
Note that this is different from being part of the crate’s public API: to be part of the public API, an item has to also be reachable from public items in the crate root. For example:
mod foo {
pub struct X;
}
mod bar {
pub fn something(_x: super::foo::X) {}
}
pub use bar::something; // exposes `X`
Without the pub use ...
, neither X
nor something
would be part of the crate’s public
API (this is called “pub-in-priv” items). With or without the pub use
, we set public = true
; computing item reachability is harder.
Trait Implementations§
source§impl<'de> Deserialize<'de> for AttrInfo
impl<'de> Deserialize<'de> for AttrInfo
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl<'s, V> Drive<'s, V> for AttrInfo
impl<'s, V> Drive<'s, V> for AttrInfo
source§fn drive_inner(&'s self, visitor: &mut V) -> ControlFlow<V::Break>
fn drive_inner(&'s self, visitor: &mut V) -> ControlFlow<V::Break>
v.visit()
on the immediate contents of self
.source§impl<'s, V> DriveMut<'s, V> for AttrInfo
impl<'s, V> DriveMut<'s, V> for AttrInfo
source§fn drive_inner_mut(&'s mut self, visitor: &mut V) -> ControlFlow<V::Break>
fn drive_inner_mut(&'s mut self, visitor: &mut V) -> ControlFlow<V::Break>
v.visit()
on the immediate contents of self
.Auto Trait Implementations§
impl Freeze for AttrInfo
impl RefUnwindSafe for AttrInfo
impl Send for AttrInfo
impl Sync for AttrInfo
impl Unpin for AttrInfo
impl UnwindSafe for AttrInfo
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<I, T> ExtractContext<I, ()> for T
impl<I, T> ExtractContext<I, ()> for T
§fn extract_context(self, _original_input: I)
fn extract_context(self, _original_input: I)
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more