pub struct Platform { /* private fields */ }Expand description
A platform describes the target CoreArchitecture and platform-specific information such as
the calling conventions and generic types (think HRESULT on Windows).
Implementations§
Source§impl Platform
impl Platform
pub unsafe fn from_raw(handle: *mut BNPlatform) -> Self
pub fn by_name(name: &str) -> Option<Ref<Self>>
pub fn list_all() -> Array<Platform>
pub fn list_by_arch(arch: &CoreArchitecture) -> Array<Platform>
pub fn list_by_os(name: &str) -> Array<Platform>
pub fn list_by_os_and_arch( name: &str, arch: &CoreArchitecture, ) -> Array<Platform>
pub fn list_available_os() -> Array<BnString>
pub fn new<A: Architecture>(arch: &A, name: &str) -> Ref<Self>
pub fn name(&self) -> String
pub fn arch(&self) -> CoreArchitecture
Sourcepub fn address_size(&self) -> usize
pub fn address_size(&self) -> usize
Get the address size of the platform, this is typically the same as the architecture’s address size, but some platforms like Linux x86_64 x32 ABI have differing address sizes from architecture.
pub fn type_container(&self) -> TypeContainer
Sourcepub fn get_type_libraries_by_name(&self, name: &str) -> Array<TypeLibrary>
pub fn get_type_libraries_by_name(&self, name: &str) -> Array<TypeLibrary>
Get all the type libraries that have been registered with the name.
NOTE: This is a list because libraries can have alternate_names, use Platform::get_type_library_by_name
if you want to get the type library with that name, skipping alternate names.
Sourcepub fn get_type_library_by_name(&self, name: &str) -> Option<Ref<TypeLibrary>>
pub fn get_type_library_by_name(&self, name: &str) -> Option<Ref<TypeLibrary>>
Get the type library with the given name.
NOTE: This finds the first type library that has the given name, skipping alternate names.
pub fn register_os(&self, os: &str)
pub fn get_default_calling_convention( &self, ) -> Option<Ref<CoreCallingConvention>>
pub fn set_default_calling_convention(&self, cc: &CoreCallingConvention)
pub fn get_cdecl_calling_convention(&self) -> Option<Ref<CoreCallingConvention>>
pub fn set_cdecl_calling_convention(&self, cc: &CoreCallingConvention)
pub fn get_stdcall_calling_convention( &self, ) -> Option<Ref<CoreCallingConvention>>
pub fn set_stdcall_calling_convention(&self, cc: &CoreCallingConvention)
pub fn get_fastcall_calling_convention( &self, ) -> Option<Ref<CoreCallingConvention>>
pub fn set_fastcall_calling_convention(&self, cc: &CoreCallingConvention)
pub fn get_syscall_convention(&self) -> Option<Ref<CoreCallingConvention>>
pub fn set_syscall_convention(&self, cc: &CoreCallingConvention)
Sourcepub fn register_calling_convention(&self, cc: &CoreCallingConvention)
pub fn register_calling_convention(&self, cc: &CoreCallingConvention)
Register a calling convention with the platform, adding it to Platform::calling_conventions.
Unlike Platform::set_default_calling_convention and the other role setters, this does not
assign the calling convention to a role, it only makes it available on the platform.
§Panics
Panics if the calling convention’s architecture does not match the platform’s architecture.