Skip to content

Support of lifetimes in message struct #18

@paaaav

Description

@paaaav

Hello,

I'd like to specify lifetimes for a message. Manually implementing them works fine, so this is something the parser could support. See this reference

how it looks if done manually:

pub struct DropItem<'a> {
	bang: &'a mut Bang,
}

pub enum WeightMessages<'a> {
	DropItem(DropItem<'a>),
	TakeItem(TakeItem),
}

this library

pub struct DropItem<'a> {
	bang: &'a mut Bang,
}

transitions!(Weight,
  [
    (IsTaken, DropItem<'a>) => IsDropped,
    (IsDropped, DropItem<'a>) => IsDropped, 
    (IsDropped, TakeItem) => IsTaken,
    (IsTaken, TakeItem) => IsTaken
  ]
);

Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions