pub struct EvtDecl {
pub name: String,
pub carriers: Vec<(Type, String)>,
pub body: Vec<Statement>,
pub span: Range<usize>,
}Expand description
A computation-event declaration.
Syntax:
evt ident carriers? ':' (stmt | '{' stmt* '}')
carriers ::= ('.' '|' param (',' param)* '|')+
param ::= ident ':' typeCarriers are read-only inputs supplied by the invoking process.
Multiple carriers may be grouped (.|x: int, y: int|) or chained
(.|x: int|.|y: int|); both forms are equivalent. Names follow
snake_case convention (lowercase first letter), distinguishing
events visually from sub-processes.
The body is one statement (: stmt;) or any number in braces.
§Example
evt handle_irq: eth.handle_irq();
evt handle_packet.|size: int|: {
local_buf = eth.alloc(size);
counter = counter + 1;
}Language reference: Event Declarations.
Fields§
§name: StringEvent name (snake_case, lowercase by convention).
carriers: Vec<(Type, String)>Carriers in declaration order. Empty for events with no
.|...| clause. Each entry is (type, name).
body: Vec<Statement>Event body: the statements after the :.
span: Range<usize>Byte span of the declaration in the source.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EvtDecl
impl RefUnwindSafe for EvtDecl
impl Send for EvtDecl
impl Sync for EvtDecl
impl Unpin for EvtDecl
impl UnsafeUnpin for EvtDecl
impl UnwindSafe for EvtDecl
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.