Skip to main content

type_description

Function type_description 

Source
pub fn type_description(
    type_id: u32,
    type_registry: &PortableRegistry,
    format: bool,
) -> Result<String>
Expand description

Describes the type that is registered under the given type_id. This type description is supposed to be very close to actual rust types, with some minar differences:

  • The struct keyword is omitted. So the description of struct Human { age: u8 } is just Human { age: u8 }.
  • Types are presented in a nested fashion, similar to how structures can be defined in e.g. the C programming language.

If the format flag is enabled, the end result is formatted across multiple lines. Otherwise the description will be one single line string.