pub struct Decl {
pub loc: SourceRange,
pub key: DeclKey,
pub desc: DeclDesc,
}
Fields§
§loc: SourceRange
§key: DeclKey
Unique identifier used to refer to the AST node in compilation environments.
desc: DeclDesc
Implementations§
Source§impl Decl
impl Decl
pub fn id(&self) -> Option<&str>
pub fn parent_id(&self) -> Option<&str>
pub fn constraints(&self) -> Iter<'_, Constraint>
pub fn fields(&self) -> Iter<'_, Field>
Sourcepub fn payload(&self) -> Option<&Field>
pub fn payload(&self) -> Option<&Field>
Return the reference to the payload or body field in a declaration, if present.
Sourcepub fn payload_size(&self) -> Option<&Field>
pub fn payload_size(&self) -> Option<&Field>
Return the reference to the payload or body size field in a declaration, if present.
Sourcepub fn array_size(&self, id: &str) -> Option<&Field>
pub fn array_size(&self, id: &str) -> Option<&Field>
Return the reference to the array size or count field in a declaration, if present.
pub fn kind(&self) -> &str
Trait Implementations§
impl Eq for Decl
Auto Trait Implementations§
impl Freeze for Decl
impl RefUnwindSafe for Decl
impl Send for Decl
impl Sync for Decl
impl Unpin for Decl
impl UnwindSafe for Decl
Blanket Implementations§
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