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
Sourcepub fn set_width(&self, width: usize) -> &Self
pub fn set_width(&self, width: usize) -> &Self
Set the width of the type.
Typically only done for named type references, which will not have their width set otherwise.
Sourcepub fn set_alignment(&self, alignment: usize) -> &Self
pub fn set_alignment(&self, alignment: usize) -> &Self
Set the alignment of the type.
Typically only done for named type references, which will not have their alignment set otherwise.
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 function<'a, T: Into<Conf<&'a Type>>>(
return_type: T,
parameters: Vec<FunctionParameter>,
variable_arguments: bool,
) -> Self
pub fn function<'a, T: Into<Conf<&'a Type>>>( return_type: T, parameters: Vec<FunctionParameter>, variable_arguments: bool, ) -> Self
NOTE: This is likely to be deprecated and removed in favor of a function type builder, please
use Type::function where possible.
Sourcepub fn function_with_opts<'a, T: Into<Conf<&'a Type>>, C: Into<Conf<Ref<CoreCallingConvention>>>>(
return_type: T,
parameters: &[FunctionParameter],
variable_arguments: bool,
calling_convention: C,
stack_adjust: Conf<i64>,
) -> Self
pub fn function_with_opts<'a, T: Into<Conf<&'a Type>>, C: Into<Conf<Ref<CoreCallingConvention>>>>( return_type: T, parameters: &[FunctionParameter], variable_arguments: bool, calling_convention: C, stack_adjust: Conf<i64>, ) -> Self
NOTE: This is likely to be deprecated and removed in favor of a function type builder, please
use Type::function_with_opts where possible.
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.
pub fn pointer_with_options<'a, A: Architecture, T: Into<Conf<&'a Type>>>( arch: &A, ty: T, is_const: bool, is_volatile: bool, ref_type: Option<ReferenceType>, ) -> Self
pub fn pointer_of_width<'a, T: Into<Conf<&'a Type>>>( ty: T, size: usize, is_const: bool, is_volatile: bool, ref_type: Option<ReferenceType>, ) -> Self
Trait Implementations§
Source§impl Display for TypeBuilder
impl Display for TypeBuilder
Source§impl Drop for TypeBuilder
impl Drop for TypeBuilder
Source§impl Hash for TypeBuilder
impl Hash for TypeBuilder
Source§impl PartialEq for TypeBuilder
impl PartialEq for TypeBuilder
impl Eq for TypeBuilder
impl StructuralPartialEq for TypeBuilder
Auto Trait Implementations§
impl Freeze for TypeBuilder
impl RefUnwindSafe for TypeBuilder
impl !Send for TypeBuilder
impl !Sync for TypeBuilder
impl Unpin for TypeBuilder
impl UnwindSafe for TypeBuilder
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
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more