pub struct AppId(/* private fields */);Expand description
A type-safe, zero-cost wrapper for a cFE Application ID.
This is a lightweight, Copy-able handle that represents a unique application.
It can be used to query information about that specific application.
Implementations§
Source§impl AppId
impl AppId
Sourcepub fn info(&self) -> Result<AppInfo>
pub fn info(&self) -> Result<AppInfo>
Retrieves detailed information about the application with this ID.
§Errors
Returns an error if the App ID is not valid or if the underlying CFE call fails.
Sourcepub fn name(&self) -> Result<String<{ _ }>>
pub fn name(&self) -> Result<String<{ _ }>>
Retrieves the name for this application ID.
§Errors
Returns an error if the App ID is not valid, the buffer is too small, or the name is not valid UTF-8.
Sourcepub fn to_index(&self) -> Result<u32>
pub fn to_index(&self) -> Result<u32>
Converts the App ID into a zero-based integer suitable for array indexing.
§Errors
Returns an error if the App ID is not valid or if the underlying CFE call fails.
Sourcepub fn restart(&self) -> Result<()>
pub fn restart(&self) -> Result<()>
Requests cFE to restart this application.
If the application file is missing or corrupt at restart time,
the application may be permanently deleted and unrecoverable
except via the ES_STARTAPP ground command.
§Errors
Returns an error if the app_id is invalid or if the restart command fails.
Sourcepub fn reload(&self, filename: &str) -> Result<()>
pub fn reload(&self, filename: &str) -> Result<()>
Requests cFE to reload this application from a new file.
If the file is missing or corrupt, the application may be
permanently deleted and unrecoverable except via the
ES_STARTAPP ground command.
§Arguments
filename: The path to the new application binary file.
§Errors
Returns an error if the app_id is invalid, the filename is invalid,
the file cannot be accessed, or the reload command fails.
Sourcepub fn delete(&self) -> Result<()>
pub fn delete(&self) -> Result<()>
Requests cFE to delete this application.
§Errors
Returns an error if the app_id is invalid or if the delete command fails.
Source§impl AppId
impl AppId
Sourcepub fn send_event(
&self,
event_id: u16,
event_type: EventType,
message: &str,
) -> Result<()>
pub fn send_event( &self, event_id: u16, event_type: EventType, message: &str, ) -> Result<()>
Sends a formatted software event that appears to originate from this application.
This allows a library or shared service to send an event on behalf of another application.
§Errors
Returns an error if the underlying CFE_EVS_SendEventWithAppID call fails.