Struct rune::ast::ItemImpl [−][src]
An impl item.
Examples
use rune::{testing, ast}; testing::roundtrip::<ast::ItemImpl>("impl Foo {}"); testing::roundtrip::<ast::ItemImpl>("impl Foo { fn test(self) { } }"); testing::roundtrip::<ast::ItemImpl>("#[variant(enum_= \"SuperHero\", x = \"1\")] impl Foo { fn test(self) { } }"); testing::roundtrip::<ast::ItemImpl>("#[xyz] impl Foo { #[jit] fn test(self) { } }");
Fields
attributes: Vec<Attribute>
The attributes of the impl
block
impl_: Impl
The impl
keyword.
path: Path
Path of the implementation.
open: OpenBrace
The open brace.
functions: Vec<ItemFn>
The collection of functions.
close: CloseBrace
The close brace.
Implementations
impl ItemImpl
[src]
pub fn parse_with_attributes(
parser: &mut Parser<'_>,
attributes: Vec<Attribute>
) -> Result<Self, ParseError>
[src]
parser: &mut Parser<'_>,
attributes: Vec<Attribute>
) -> Result<Self, ParseError>
Parse an impl
item with the given attributes.
Trait Implementations
impl Clone for ItemImpl
[src]
impl Debug for ItemImpl
[src]
impl Eq for ItemImpl
[src]
impl Parse for ItemImpl
[src]
fn parse(p: &mut Parser<'_>) -> Result<Self, ParseError>
[src]
impl PartialEq<ItemImpl> for ItemImpl
[src]
impl Spanned for ItemImpl
[src]
impl StructuralEq for ItemImpl
[src]
impl StructuralPartialEq for ItemImpl
[src]
impl ToTokens for ItemImpl
[src]
fn to_tokens(&self, context: &MacroContext, stream: &mut TokenStream)
[src]
Auto Trait Implementations
impl RefUnwindSafe for ItemImpl
impl Send for ItemImpl
impl Sync for ItemImpl
impl Unpin for ItemImpl
impl UnwindSafe for ItemImpl
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
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]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,