pub struct Item {
pub doc: Option<String>,
pub exported: bool,
pub is_test: bool,
pub is_opaque: bool,
pub kind: ItemKind,
pub span: Span,
}Expand description
A top-level declaration.
Fields§
§doc: Option<String>§exported: bool§is_test: booltest fn name() -> Result<Unit, Error>: a declaration the test
runner calls and nothing else does.
test occupies the position export occupies and says the
comparable thing — who may call this — so a declaration carries at
most one of the two, and only a fn carries test at all.
is_opaque: boolexport opaque struct User { ... }: the export publishes the type’s
name and its exported methods, and nothing about how it is built.
opaque narrows an export rather than standing in for one, so it
only ever appears together with one, and only on a struct: exporting
an enum exports its cases, because a match over them is what the
enum is for. See ADR 0014.
kind: ItemKind§span: SpanTrait Implementations§
Auto Trait Implementations§
impl Freeze for Item
impl RefUnwindSafe for Item
impl Send for Item
impl Sync for Item
impl Unpin for Item
impl UnsafeUnpin for Item
impl UnwindSafe for Item
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
Mutably borrows from an owned value. Read more