plotnik_lib/ir/
entrypoint.rs1use super::ids::{StringId, TransitionId, TypeId};
7
8#[repr(C)]
12#[derive(Debug, Clone, Copy)]
13pub struct Entrypoint {
14 name_id: StringId,
16 _pad: u16,
17 target: TransitionId,
19 result_type: TypeId,
21 _pad2: u16,
22}
23
24const _: () = assert!(size_of::<Entrypoint>() == 12);
25const _: () = assert!(align_of::<Entrypoint>() == 4);
26
27impl Entrypoint {
28 pub const fn new(name_id: StringId, target: TransitionId, result_type: TypeId) -> Self {
30 Self {
31 name_id,
32 _pad: 0,
33 target,
34 result_type,
35 _pad2: 0,
36 }
37 }
38
39 #[inline]
41 pub const fn name_id(&self) -> StringId {
42 self.name_id
43 }
44
45 #[inline]
47 pub const fn target(&self) -> TransitionId {
48 self.target
49 }
50
51 #[inline]
53 pub const fn result_type(&self) -> TypeId {
54 self.result_type
55 }
56}