Enum ra_ap_syntax::ast::Item[][src]

pub enum Item {
Show variants Const(Const), Enum(Enum), ExternBlock(ExternBlock), ExternCrate(ExternCrate), Fn(Fn), Impl(Impl), MacroCall(MacroCall), MacroRules(MacroRules), MacroDef(MacroDef), Module(Module), Static(Static), Struct(Struct), Trait(Trait), TypeAlias(TypeAlias), Union(Union), Use(Use),
}

Variants

Const(Const)
Enum(Enum)
ExternBlock(ExternBlock)
ExternCrate(ExternCrate)
Fn(Fn)
Impl(Impl)
MacroCall(MacroCall)
MacroRules(MacroRules)
MacroDef(MacroDef)
Module(Module)
Static(Static)
Struct(Struct)
Trait(Trait)
TypeAlias(TypeAlias)
Union(Union)
Use(Use)

Implementations

impl Item[src]

pub fn parse(text: &str) -> Result<Self, ()>[src]

Returns text, parsed as an item, but only if it has no errors.

Trait Implementations

impl AstNode for Item[src]

fn can_cast(kind: SyntaxKind) -> bool[src]

fn cast(syntax: SyntaxNode) -> Option<Self>[src]

fn syntax(&self) -> &SyntaxNode[src]

fn clone_for_update(&self) -> Self where
    Self: Sized
[src]

fn clone_subtree(&self) -> Self where
    Self: Sized
[src]

impl AttrsOwner for Item[src]

fn attrs(&self) -> AstChildren<Attr>

Notable traits for AstChildren<N>

impl<N: AstNode> Iterator for AstChildren<N> type Item = N;
[src]

fn has_atom_attr(&self, atom: &str) -> bool[src]

impl Clone for Item[src]

fn clone(&self) -> Item[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Item[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl Display for Item[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl From<Const> for Item[src]

fn from(node: Const) -> Item[src]

Performs the conversion.

impl From<Enum> for Item[src]

fn from(node: Enum) -> Item[src]

Performs the conversion.

impl From<ExternBlock> for Item[src]

fn from(node: ExternBlock) -> Item[src]

Performs the conversion.

impl From<ExternCrate> for Item[src]

fn from(node: ExternCrate) -> Item[src]

Performs the conversion.

impl From<Fn> for Item[src]

fn from(node: Fn) -> Item[src]

Performs the conversion.

impl From<Impl> for Item[src]

fn from(node: Impl) -> Item[src]

Performs the conversion.

impl From<Item> for Stmt[src]

fn from(node: Item) -> Stmt[src]

Performs the conversion.

impl From<MacroCall> for Item[src]

fn from(node: MacroCall) -> Item[src]

Performs the conversion.

impl From<MacroDef> for Item[src]

fn from(node: MacroDef) -> Item[src]

Performs the conversion.

impl From<MacroRules> for Item[src]

fn from(node: MacroRules) -> Item[src]

Performs the conversion.

impl From<Module> for Item[src]

fn from(node: Module) -> Item[src]

Performs the conversion.

impl From<Static> for Item[src]

fn from(node: Static) -> Item[src]

Performs the conversion.

impl From<Struct> for Item[src]

fn from(node: Struct) -> Item[src]

Performs the conversion.

impl From<Trait> for Item[src]

fn from(node: Trait) -> Item[src]

Performs the conversion.

impl From<TypeAlias> for Item[src]

fn from(node: TypeAlias) -> Item[src]

Performs the conversion.

impl From<Union> for Item[src]

fn from(node: Union) -> Item[src]

Performs the conversion.

impl From<Use> for Item[src]

fn from(node: Use) -> Item[src]

Performs the conversion.

impl Hash for Item[src]

fn hash<__H: Hasher>(&self, state: &mut __H)[src]

Feeds this value into the given Hasher. Read more

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0[src]

Feeds a slice of this type into the given Hasher. Read more

impl PartialEq<Item> for Item[src]

fn eq(&self, other: &Item) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &Item) -> bool[src]

This method tests for !=.

impl Eq for Item[src]

impl StructuralEq for Item[src]

impl StructuralPartialEq for Item[src]

Auto Trait Implementations

impl !RefUnwindSafe for Item

impl !Send for Item

impl !Sync for Item

impl Unpin for Item

impl !UnwindSafe for Item

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<N> AstNodeEdit for N where
    N: AstNode + Clone
[src]

#[must_use]
fn replace_children(
    &self,
    to_replace: RangeInclusive<SyntaxElement>,
    to_insert: impl IntoIterator<Item = SyntaxElement>
) -> Self
[src]

fn indent_level(&self) -> IndentLevel[src]

#[must_use]
fn indent(&self, level: IndentLevel) -> Self
[src]

#[must_use]
fn dedent(&self, level: IndentLevel) -> Self
[src]

#[must_use]
fn reset_indent(&self) -> Self
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

pub fn equivalent(&self, key: &K) -> bool[src]

Compare self to key and return true if they are equal.

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T> ToString for T where
    T: Display + ?Sized
[src]

pub default fn to_string(&self) -> String[src]

Converts the given value to a String. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.