Skip to main content

AppId

Struct AppId 

Source
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

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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

pub fn from_name(name: &str) -> Result<AppId>

Retrieves the cFE Application ID for a given application name.

§Arguments
  • name: The registered name of the application to look up.
§Errors

Returns an error if no application with the given name is found, or if the name is too long for the internal CFE buffers.

Source

pub fn this() -> Result<AppId>

Returns the ID of the currently running application.

Child tasks return the same application ID as their parent.

§Errors

Returns an error if called from a context that is not a registered cFE application task.

Source§

impl AppId

Source

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.

Methods from Deref<Target = u32>§

1.43.0 · Source

pub const MIN: u32 = 0

1.43.0 · Source

pub const MAX: u32

1.53.0 · Source

pub const BITS: u32

Trait Implementations§

Source§

impl Clone for AppId

Source§

fn clone(&self) -> AppId

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AppId

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Deref for AppId

Source§

type Target = u32

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl From<AppId> for ResourceId

Source§

fn from(app_id: AppId) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for AppId

Source§

fn eq(&self, other: &AppId) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for AppId

Source§

impl Eq for AppId

Source§

impl StructuralPartialEq for AppId

Auto Trait Implementations§

§

impl Freeze for AppId

§

impl RefUnwindSafe for AppId

§

impl Send for AppId

§

impl Sync for AppId

§

impl Unpin for AppId

§

impl UnsafeUnpin for AppId

§

impl UnwindSafe for AppId

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.