pub trait TypePrinter {
// Required methods
fn get_type_tokens<T: Into<QualifiedName>>(
&self,
type_: Ref<Type>,
platform: Option<Ref<Platform>>,
name: T,
base_confidence: u8,
escaping: TokenEscapingType,
) -> Option<Vec<InstructionTextToken>>;
fn get_type_tokens_before_name(
&self,
type_: Ref<Type>,
platform: Option<Ref<Platform>>,
base_confidence: u8,
parent_type: Option<Ref<Type>>,
escaping: TokenEscapingType,
) -> Option<Vec<InstructionTextToken>>;
fn get_type_tokens_after_name(
&self,
type_: Ref<Type>,
platform: Option<Ref<Platform>>,
base_confidence: u8,
parent_type: Option<Ref<Type>>,
escaping: TokenEscapingType,
) -> Option<Vec<InstructionTextToken>>;
fn get_type_string<T: Into<QualifiedName>>(
&self,
type_: Ref<Type>,
platform: Option<Ref<Platform>>,
name: T,
escaping: TokenEscapingType,
) -> Option<String>;
fn get_type_string_before_name(
&self,
type_: Ref<Type>,
platform: Option<Ref<Platform>>,
escaping: TokenEscapingType,
) -> Option<String>;
fn get_type_string_after_name(
&self,
type_: Ref<Type>,
platform: Option<Ref<Platform>>,
escaping: TokenEscapingType,
) -> Option<String>;
fn get_type_lines<T: Into<QualifiedName>>(
&self,
type_: Ref<Type>,
types: &TypeContainer,
name: T,
padding_cols: isize,
collapsed: bool,
escaping: TokenEscapingType,
) -> Option<Vec<TypeDefinitionLine>>;
fn print_all_types(
&self,
names: Vec<QualifiedName>,
types: Vec<Ref<Type>>,
data: Ref<BinaryView>,
padding_cols: isize,
escaping: TokenEscapingType,
) -> Option<String>;
}
Required Methods§
sourcefn get_type_tokens<T: Into<QualifiedName>>(
&self,
type_: Ref<Type>,
platform: Option<Ref<Platform>>,
name: T,
base_confidence: u8,
escaping: TokenEscapingType,
) -> Option<Vec<InstructionTextToken>>
fn get_type_tokens<T: Into<QualifiedName>>( &self, type_: Ref<Type>, platform: Option<Ref<Platform>>, name: T, base_confidence: u8, escaping: TokenEscapingType, ) -> Option<Vec<InstructionTextToken>>
Generate a single-line text representation of a type, Returns a List of text tokens representing the type.
type_
- Type to printplatform
- Platform responsible for this typename
- Name of the typebase_confidence
- Confidence to use for tokens created for this typeescaping
- Style of escaping literals which may not be parsable
sourcefn get_type_tokens_before_name(
&self,
type_: Ref<Type>,
platform: Option<Ref<Platform>>,
base_confidence: u8,
parent_type: Option<Ref<Type>>,
escaping: TokenEscapingType,
) -> Option<Vec<InstructionTextToken>>
fn get_type_tokens_before_name( &self, type_: Ref<Type>, platform: Option<Ref<Platform>>, base_confidence: u8, parent_type: Option<Ref<Type>>, escaping: TokenEscapingType, ) -> Option<Vec<InstructionTextToken>>
In a single-line text representation of a type, generate the tokens that should be printed before the type’s name. Returns a list of text tokens representing the type
type_
- Type to printplatform
- Platform responsible for this typebase_confidence
- Confidence to use for tokens created for this typeparent_type
- Type of the parent of this type, or Noneescaping
- Style of escaping literals which may not be parsable
sourcefn get_type_tokens_after_name(
&self,
type_: Ref<Type>,
platform: Option<Ref<Platform>>,
base_confidence: u8,
parent_type: Option<Ref<Type>>,
escaping: TokenEscapingType,
) -> Option<Vec<InstructionTextToken>>
fn get_type_tokens_after_name( &self, type_: Ref<Type>, platform: Option<Ref<Platform>>, base_confidence: u8, parent_type: Option<Ref<Type>>, escaping: TokenEscapingType, ) -> Option<Vec<InstructionTextToken>>
In a single-line text representation of a type, generate the tokens that should be printed after the type’s name. Returns a list of text tokens representing the type
type_
- Type to printplatform
- Platform responsible for this typebase_confidence
- Confidence to use for tokens created for this typeparent_type
- Type of the parent of this type, or Noneescaping
- Style of escaping literals which may not be parsable
sourcefn get_type_string<T: Into<QualifiedName>>(
&self,
type_: Ref<Type>,
platform: Option<Ref<Platform>>,
name: T,
escaping: TokenEscapingType,
) -> Option<String>
fn get_type_string<T: Into<QualifiedName>>( &self, type_: Ref<Type>, platform: Option<Ref<Platform>>, name: T, escaping: TokenEscapingType, ) -> Option<String>
Generate a single-line text representation of a type. Returns a string representing the type
type_
- Type to printplatform
- Platform responsible for this typename
- Name of the typeescaping
- Style of escaping literals which may not be parsable
sourcefn get_type_string_before_name(
&self,
type_: Ref<Type>,
platform: Option<Ref<Platform>>,
escaping: TokenEscapingType,
) -> Option<String>
fn get_type_string_before_name( &self, type_: Ref<Type>, platform: Option<Ref<Platform>>, escaping: TokenEscapingType, ) -> Option<String>
In a single-line text representation of a type, generate the string that should be printed before the type’s name. Returns a string representing the type
type_
- Type to printplatform
- Platform responsible for this typeescaping
- Style of escaping literals which may not be parsable
sourcefn get_type_string_after_name(
&self,
type_: Ref<Type>,
platform: Option<Ref<Platform>>,
escaping: TokenEscapingType,
) -> Option<String>
fn get_type_string_after_name( &self, type_: Ref<Type>, platform: Option<Ref<Platform>>, escaping: TokenEscapingType, ) -> Option<String>
In a single-line text representation of a type, generate the string that should be printed after the type’s name. Returns a string representing the type
type_
- Type to printplatform
- Platform responsible for this typeescaping
- Style of escaping literals which may not be parsable
sourcefn get_type_lines<T: Into<QualifiedName>>(
&self,
type_: Ref<Type>,
types: &TypeContainer,
name: T,
padding_cols: isize,
collapsed: bool,
escaping: TokenEscapingType,
) -> Option<Vec<TypeDefinitionLine>>
fn get_type_lines<T: Into<QualifiedName>>( &self, type_: Ref<Type>, types: &TypeContainer, name: T, padding_cols: isize, collapsed: bool, escaping: TokenEscapingType, ) -> Option<Vec<TypeDefinitionLine>>
Generate a multi-line representation of a type. Returns a list of type definition lines
type_
- Type to printtypes
- Type Container containing the type and dependenciesname
- Name of the typepadding_cols
- Maximum number of bytes represented by each padding linecollapsed
- Whether to collapse structure/enum blocksescaping
- Style of escaping literals which may not be parsable
sourcefn print_all_types(
&self,
names: Vec<QualifiedName>,
types: Vec<Ref<Type>>,
data: Ref<BinaryView>,
padding_cols: isize,
escaping: TokenEscapingType,
) -> Option<String>
fn print_all_types( &self, names: Vec<QualifiedName>, types: Vec<Ref<Type>>, data: Ref<BinaryView>, padding_cols: isize, escaping: TokenEscapingType, ) -> Option<String>
Print all types to a single big string, including headers, sections, etc.
types
- All types to printdata
- Binary View in which all the types are definedpadding_cols
- Maximum number of bytes represented by each padding lineescaping
- Style of escaping literals which may not be parsable