pub struct SwBaseType(/* private fields */);
Expand description
SwBaseType
is a basic data type.
It is used to define the data types of signals and variables.
Use ArPackage::create_sw_base_type
to create a new SwBaseType
.
§Example
let package = model.get_or_create_package("/my/pkg")?;
let base_type = package.create_sw_base_type("MyBaseType",
8, BaseTypeEncoding::None, None, None, Some("uint8"))?;
assert!(model.get_element_by_path("/my/pkg/MyBaseType").is_some());
Implementations§
Source§impl SwBaseType
impl SwBaseType
Sourcepub fn set_bit_length(
&self,
bit_length: u32,
) -> Result<(), AutosarAbstractionError>
pub fn set_bit_length( &self, bit_length: u32, ) -> Result<(), AutosarAbstractionError>
set the base type size (in bits) of the SwBaseType
Sourcepub fn bit_length(&self) -> Option<u32>
pub fn bit_length(&self) -> Option<u32>
get the bit length of the SwBaseType
Sourcepub fn set_base_type_encoding(
&self,
base_type_encoding: BaseTypeEncoding,
) -> Result<(), AutosarAbstractionError>
pub fn set_base_type_encoding( &self, base_type_encoding: BaseTypeEncoding, ) -> Result<(), AutosarAbstractionError>
set the base type encoding of the SwBaseType
Sourcepub fn base_type_encoding(&self) -> Option<BaseTypeEncoding>
pub fn base_type_encoding(&self) -> Option<BaseTypeEncoding>
get the base type encoding of the SwBaseType
Sourcepub fn set_byte_order(
&self,
byte_order: ByteOrder,
) -> Result<(), AutosarAbstractionError>
pub fn set_byte_order( &self, byte_order: ByteOrder, ) -> Result<(), AutosarAbstractionError>
set the byte order of the SwBaseType
The byte order is platform specific and should only be set when it is really needed.
Sourcepub fn byte_order(&self) -> Option<ByteOrder>
pub fn byte_order(&self) -> Option<ByteOrder>
get the byte order of the SwBaseType
Sourcepub fn set_mem_alignment(
&self,
mem_alignment: u32,
) -> Result<(), AutosarAbstractionError>
pub fn set_mem_alignment( &self, mem_alignment: u32, ) -> Result<(), AutosarAbstractionError>
set the memory alignment of the SwBaseType
The memory alignment describes the slignement in bits. Example: 8 means that the type is aligned to a byte. Since the memory alignment is platform specific, it should only be set when it is really needed.
Sourcepub fn mem_alignment(&self) -> Option<u32>
pub fn mem_alignment(&self) -> Option<u32>
get the memory alignment of the SwBaseType
Sourcepub fn set_native_declaration(
&self,
native_declaration: &str,
) -> Result<(), AutosarAbstractionError>
pub fn set_native_declaration( &self, native_declaration: &str, ) -> Result<(), AutosarAbstractionError>
set the native declaration of the SwBaseType
The native declaration is a string that represents the type in the native programming language.
Sourcepub fn native_declaration(&self) -> Option<String>
pub fn native_declaration(&self) -> Option<String>
get the native declaration of the SwBaseType
Trait Implementations§
Source§impl AbstractionElement for SwBaseType
impl AbstractionElement for SwBaseType
Source§impl Clone for SwBaseType
impl Clone for SwBaseType
Source§fn clone(&self) -> SwBaseType
fn clone(&self) -> SwBaseType
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for SwBaseType
impl Debug for SwBaseType
Source§impl From<SwBaseType> for Element
impl From<SwBaseType> for Element
Source§fn from(val: SwBaseType) -> Self
fn from(val: SwBaseType) -> Self
Source§impl Hash for SwBaseType
impl Hash for SwBaseType
Source§impl PartialEq for SwBaseType
impl PartialEq for SwBaseType
Source§impl TryFrom<Element> for SwBaseType
impl TryFrom<Element> for SwBaseType
impl Eq for SwBaseType
impl StructuralPartialEq for SwBaseType
Auto Trait Implementations§
impl Freeze for SwBaseType
impl !RefUnwindSafe for SwBaseType
impl Send for SwBaseType
impl Sync for SwBaseType
impl Unpin for SwBaseType
impl !UnwindSafe for SwBaseType
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.