Functions | Variables
genrs Namespace Reference

Functions

def _escape_string (s)
 
def default_value (type, package)
 
def depending_on (spec)
 
def escape_message_definition (definition)
 
def msg_type_to_rs (type, package)
 

Variables

dictionary MSG_TYPE_TO_RS
 

Function Documentation

def genrs._escape_string (   s)
private

Definition at line 115 of file __init__.py.

def genrs.default_value (   type,
  package 
)
Returns the value to initialize a message member with.

0 for integer types and times,
0.0 for floating point,
false for bool,
default string for string,
::new() for everything else

@param type: The type
@type type: str

Definition at line 78 of file __init__.py.

def genrs.depending_on (   spec)
Creates a list of unique packages based on dependencies

Definition at line 28 of file __init__.py.

def genrs.escape_message_definition (   definition)

Definition at line 121 of file __init__.py.

def genrs.msg_type_to_rs (   type,
  package 
)
Converts a message type (e.g. uint32, std_msgs/String, etc.) into the Rust declaration
for that type (e.g. u32, std_msgs.String)

@param type: The message type
@type type: str
@return: The Rust declaration
@rtype: str

Definition at line 45 of file __init__.py.

Variable Documentation

dictionary genrs.MSG_TYPE_TO_RS
Initial value:
1 = {
2  'byte': 'i8',
3  'char': 'u8',
4  'bool': 'bool',
5  'uint8': 'u8',
6  'uint16': 'u16',
7  'uint32': 'u32',
8  'uint64': 'u64',
9  'int8': 'i8',
10  'int16': 'i16',
11  'int32': 'i32',
12  'int64': 'i64',
13  'float32': 'f32',
14  'float64': 'f64',
15  'string': '::std::string::String',
16  'time': 'u32',
17  'duration': 'i32',
18 }

Definition at line 8 of file __init__.py.



genrs
Author(s): Adnan Ademovic
autogenerated on Mon Jun 10 2019 13:15:20