pub struct TypeBuilder { /* private fields */ }Implementations§
Source§impl TypeBuilder
impl TypeBuilder
pub fn new(t: &Type) -> Self
pub fn set_can_return<T: Into<Conf<bool>>>(&self, value: T) -> &Self
pub fn set_pure<T: Into<Conf<bool>>>(&self, value: T) -> &Self
pub fn set_const<T: Into<Conf<bool>>>(&self, value: T) -> &Self
pub fn set_volatile<T: Into<Conf<bool>>>(&self, value: T) -> &Self
pub fn set_pointer_base( &self, base_type: PointerBaseType, base_offset: i64, ) -> &Self
pub fn set_child_type<'a, T: Into<Conf<&'a Type>>>(&self, ty: T) -> &Self
Sourcepub fn set_target<'a, T: Into<Conf<&'a Type>>>(&self, ty: T) -> &Self
pub fn set_target<'a, T: Into<Conf<&'a Type>>>(&self, ty: T) -> &Self
This is an alias for Self::set_child_type.
Sourcepub fn set_element_type<'a, T: Into<Conf<&'a Type>>>(&self, ty: T) -> &Self
pub fn set_element_type<'a, T: Into<Conf<&'a Type>>>(&self, ty: T) -> &Self
This is an alias for Self::set_child_type.
Sourcepub fn set_return_value<'a, T: Into<Conf<&'a Type>>>(&self, ty: T) -> &Self
pub fn set_return_value<'a, T: Into<Conf<&'a Type>>>(&self, ty: T) -> &Self
This is an alias for Self::set_child_type.
pub fn set_signed<T: Into<Conf<bool>>>(&self, value: T) -> &Self
pub fn type_class(&self) -> TypeClass
pub fn width(&self) -> u64
pub fn alignment(&self) -> usize
pub fn is_signed(&self) -> Conf<bool>
pub fn is_const(&self) -> Conf<bool>
pub fn is_volatile(&self) -> Conf<bool>
pub fn is_floating_point(&self) -> bool
pub fn child_type(&self) -> Option<Conf<Ref<Type>>>
Sourcepub fn element_type(&self) -> Option<Conf<Ref<Type>>>
pub fn element_type(&self) -> Option<Conf<Ref<Type>>>
This is an alias for Self::child_type.
Sourcepub fn return_value(&self) -> Option<Conf<Ref<Type>>>
pub fn return_value(&self) -> Option<Conf<Ref<Type>>>
This is an alias for Self::child_type.
pub fn calling_convention(&self) -> Option<Conf<Ref<CoreCallingConvention>>>
pub fn parameters(&self) -> Option<Vec<FunctionParameter>>
pub fn has_variable_arguments(&self) -> Conf<bool>
pub fn can_return(&self) -> Conf<bool>
pub fn pure(&self) -> Conf<bool>
pub fn get_structure(&self) -> Option<Ref<Structure>>
pub fn get_enumeration(&self) -> Option<Ref<Enumeration>>
pub fn get_named_type_reference(&self) -> Option<Ref<NamedTypeReference>>
pub fn count(&self) -> u64
pub fn offset(&self) -> u64
pub fn stack_adjustment(&self) -> Conf<i64>
pub fn pointer_base_type(&self) -> PointerBaseType
pub fn pointer_base_offset(&self) -> i64
Sourcepub fn void() -> Self
pub fn void() -> Self
Create a void TypeBuilder. Analogous to Type::void.
Sourcepub fn bool() -> Self
pub fn bool() -> Self
Create a bool TypeBuilder. Analogous to Type::bool.
Sourcepub fn char() -> Self
pub fn char() -> Self
Create a signed one byte integer TypeBuilder. Analogous to Type::char.
Sourcepub fn int(width: usize, is_signed: bool) -> Self
pub fn int(width: usize, is_signed: bool) -> Self
Create an integer TypeBuilder with the given width and signedness. Analogous to Type::int.
Sourcepub fn named_int(width: usize, is_signed: bool, alt_name: &str) -> Self
pub fn named_int(width: usize, is_signed: bool, alt_name: &str) -> Self
Create an integer TypeBuilder with the given width and signedness and an alternative name.
Analogous to Type::named_int.
Sourcepub fn float(width: usize) -> Self
pub fn float(width: usize) -> Self
Create a float TypeBuilder with the given width. Analogous to Type::float.
Sourcepub fn named_float(width: usize, alt_name: &str) -> Self
pub fn named_float(width: usize, alt_name: &str) -> Self
Create a float TypeBuilder with the given width and alternative name. Analogous to Type::named_float.
Sourcepub fn array<'a, T: Into<Conf<&'a Type>>>(ty: T, count: u64) -> Self
pub fn array<'a, T: Into<Conf<&'a Type>>>(ty: T, count: u64) -> Self
Create an array TypeBuilder with the given element type and count. Analogous to Type::array.
Sourcepub fn enumeration<T: Into<Conf<bool>>>(
enumeration: &Enumeration,
width: NonZeroUsize,
is_signed: T,
) -> Self
pub fn enumeration<T: Into<Conf<bool>>>( enumeration: &Enumeration, width: NonZeroUsize, is_signed: T, ) -> Self
Create an enumeration TypeBuilder with the given width and signedness. Analogous to Type::enumeration.
§NOTE
The C/C++ APIs require an associated architecture, but in the core we only query the default_int_size if the given width is 0.
For simplicity’s sake, that convention isn’t followed, and you can query Architecture::default_integer_size if you need to.
Sourcepub fn structure(structure_type: &Structure) -> Self
pub fn structure(structure_type: &Structure) -> Self
Create a structure TypeBuilder. Analogous to Type::structure.
Sourcepub fn named_type(type_reference: NamedTypeReference) -> Self
pub fn named_type(type_reference: NamedTypeReference) -> Self
Create a named type reference TypeBuilder. Analogous to Type::named_type.
Sourcepub fn named_type_from_type<T: Into<QualifiedName>>(name: T, t: &Type) -> Self
pub fn named_type_from_type<T: Into<QualifiedName>>(name: T, t: &Type) -> Self
Create a named type reference TypeBuilder from a type and name. Analogous to Type::named_type_from_type.
Sourcepub fn pointer<'a, A: Architecture, T: Into<Conf<&'a Type>>>(
arch: &A,
ty: T,
) -> Self
pub fn pointer<'a, A: Architecture, T: Into<Conf<&'a Type>>>( arch: &A, ty: T, ) -> Self
Create a pointer TypeBuilder with the given target type. Analogous to Type::pointer.
Sourcepub fn const_pointer<'a, A: Architecture, T: Into<Conf<&'a Type>>>(
arch: &A,
ty: T,
) -> Self
pub fn const_pointer<'a, A: Architecture, T: Into<Conf<&'a Type>>>( arch: &A, ty: T, ) -> Self
Create a const pointer TypeBuilder with the given target type. Analogous to Type::const_pointer.