pub struct MessageSpecification {
pub pkg_name: String,
pub msg_name: String,
pub fields: Vec<Field>,
pub constants: Vec<Constant>,
pub annotations: Annotations,
}Expand description
Message specification
Fields§
§pkg_name: StringPackage name
msg_name: StringMessage name
fields: Vec<Field>List of fields
constants: Vec<Constant>List of constants
annotations: AnnotationsAnnotations for the message
Implementations§
Source§impl MessageSpecification
impl MessageSpecification
Sourcepub fn new(pkg_name: String, msg_name: String) -> ParseResult<Self>
pub fn new(pkg_name: String, msg_name: String) -> ParseResult<Self>
Create a new empty message specification
§Errors
Returns ParseError::InvalidResourceName if the package name or message name are invalid.
Sourcepub fn add_constant(&mut self, constant: Constant)
pub fn add_constant(&mut self, constant: Constant)
Add a constant to the message
Sourcepub fn get_constant(&self, name: &str) -> Option<&Constant>
pub fn get_constant(&self, name: &str) -> Option<&Constant>
Get constant by name
Sourcepub fn has_fields(&self) -> bool
pub fn has_fields(&self) -> bool
Check if message has any fields
Sourcepub fn has_constants(&self) -> bool
pub fn has_constants(&self) -> bool
Check if message has any constants
Trait Implementations§
Source§impl Clone for MessageSpecification
impl Clone for MessageSpecification
Source§fn clone(&self) -> MessageSpecification
fn clone(&self) -> MessageSpecification
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MessageSpecification
impl Debug for MessageSpecification
Source§impl Display for MessageSpecification
impl Display for MessageSpecification
Source§impl PartialEq for MessageSpecification
impl PartialEq for MessageSpecification
impl StructuralPartialEq for MessageSpecification
Auto Trait Implementations§
impl Freeze for MessageSpecification
impl RefUnwindSafe for MessageSpecification
impl Send for MessageSpecification
impl Sync for MessageSpecification
impl Unpin for MessageSpecification
impl UnsafeUnpin for MessageSpecification
impl UnwindSafe for MessageSpecification
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