#[repr(transparent)]pub struct OsalId(pub u32);Expand description
A generic, type-safe wrapper for an OSAL object ID.
Tuple Fields§
§0: u32Implementations§
Source§impl OsalId
impl OsalId
Sourcepub fn name(&self) -> Result<String<{ _ }>>
pub fn name(&self) -> Result<String<{ _ }>>
Retrieves the name of this OSAL object.
§Errors
Returns an error if the object ID is invalid, the buffer is too small
(unlikely with heapless), or the name is not valid UTF-8.
Sourcepub fn object_type(&self) -> ObjectType
pub fn object_type(&self) -> ObjectType
Identifies the type of this OSAL object.
Sourcepub fn to_index(&self) -> Result<u32>
pub fn to_index(&self) -> Result<u32>
Converts this abstract ID into a zero-based integer suitable for use as an array index.
This does NOT verify that the ID refers to a currently valid or active resource — it only performs the numeric conversion.
Sourcepub fn to_index_as_type(&self, obj_type: ObjectType) -> Result<u32>
pub fn to_index_as_type(&self, obj_type: ObjectType) -> Result<u32>
Converts this abstract ID of a specific type into a zero-based integer.
§Errors
Returns Error::OsErrInvalidId if this ID is not of the
specified obj_type or does not map to a valid index.
Trait Implementations§
impl Copy for OsalId
impl Eq for OsalId
impl StructuralPartialEq for OsalId
Auto Trait Implementations§
impl Freeze for OsalId
impl RefUnwindSafe for OsalId
impl Send for OsalId
impl Sync for OsalId
impl Unpin for OsalId
impl UnsafeUnpin for OsalId
impl UnwindSafe for OsalId
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
Mutably borrows from an owned value. Read more