pub struct Constant {
pub type_name: String,
pub name: String,
pub value: PrimitiveValue,
pub annotations: Annotations,
}Expand description
Constant definition
Fields§
§type_name: StringPrimitive type of the constant
name: StringName of the constant
value: PrimitiveValueValue of the constant
annotations: AnnotationsAnnotations attached to this constant
Implementations§
Source§impl Constant
impl Constant
Sourcepub fn new(
primitive_type: &str,
name: &str,
value_string: &str,
) -> ParseResult<Self>
pub fn new( primitive_type: &str, name: &str, value_string: &str, ) -> ParseResult<Self>
Create a new constant
§Errors
Returns an error if:
- The primitive type is not a valid ROS2 primitive type
- The constant name doesn’t follow valid naming conventions
- The value string cannot be parsed for the given primitive type
Trait Implementations§
impl StructuralPartialEq for Constant
Auto Trait Implementations§
impl Freeze for Constant
impl RefUnwindSafe for Constant
impl Send for Constant
impl Sync for Constant
impl Unpin for Constant
impl UnsafeUnpin for Constant
impl UnwindSafe for Constant
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