[][src]Struct zamm_yang::codegen::template::basic::ImplementationFragment

pub struct ImplementationFragment {
    pub trait_cfg: StructConfig,
    pub struct_cfg: StructConfig,
    pub same_file_as_trait: bool,
    pub same_file_as_struct: bool,
    pub declaration: ItemDeclaration,
    pub content: Rc<RefCell<AppendedFragment>>,
}

Fragment for a trait implementation.

Fields

trait_cfg: StructConfig

Config for the trait being implemented.

struct_cfg: StructConfig

Config for the struct the trait is being implemented for.

same_file_as_trait: bool

Whether this implementation is in the same file the trait is defined in.

same_file_as_struct: bool

Whether this implementation is in the same file the struct is defined in.

declaration: ItemDeclaration

Declaration fragment for this trait.

content: Rc<RefCell<AppendedFragment>>

Actual internal code fragments for the trait.

Implementations

impl ImplementationFragment[src]

pub fn new(trait_cfg: StructConfig, struct_cfg: StructConfig) -> Self[src]

Create a new trait implementation for the given trait and struct.

pub fn mark_same_file_as_trait(&mut self)[src]

Mark this implementation as being in the same file as the trait definition.

Matters for import purposes.

pub fn mark_same_file_as_struct(&mut self)[src]

Mark this implementation as being in the same file as the struct definition.

Matters for import purposes.

pub fn append(&mut self, fragment: Rc<RefCell<dyn CodeFragment>>)[src]

Add a fragment to the internals of this implementation.

Trait Implementations

impl CodeFragment for ImplementationFragment[src]

impl Default for ImplementationFragment[src]

impl ItemDeclarationAPI for ImplementationFragment[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

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

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

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.

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.

impl<T> Typeable for T where
    T: Any