Skip to content

Commit

Permalink
feat: remove full_doc feature
Browse files Browse the repository at this point in the history
  • Loading branch information
sevenautumns committed Jan 19, 2024
1 parent 05fcaae commit da5bf63
Show file tree
Hide file tree
Showing 14 changed files with 1 addition and 74 deletions.
3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ categories = [
repository = "https://github.com/DLR-FT/a653rs/"

[features]
default = ["strum", "serde", "full_doc"]
full_doc = []
default = ["strum", "serde"]
macros = [ "dep:a653rs_macros" ]
serde = ["dep:serde"]
strum = ["dep:strum"]
Expand Down
6 changes: 0 additions & 6 deletions src/apex/blackboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ pub(crate) mod basic {
/// - [ErrorReturnCode::NoAction]: a blackboard with given `blackboard_name` already exists
/// - [ErrorReturnCode::InvalidParam]: `max_message_size` is zero
/// - [ErrorReturnCode::InvalidMode]: our current operating mode is [OperatingMode::Normal](crate::prelude::OperatingMode::Normal)
#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
fn create_blackboard(
blackboard_name: BlackboardName,
max_message_size: MessageSize,
Expand All @@ -35,7 +34,6 @@ pub(crate) mod basic {
/// - [ErrorReturnCode::InvalidParam]: blackboard with `blackboard_id` does not exist
/// - [ErrorReturnCode::InvalidParam]: the `message` is longer than the `max_message_size` specified for this blackboard
/// - [ErrorReturnCode::InvalidParam]: `message` length is zero
#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
fn display_blackboard(
blackboard_id: BlackboardId,
message: &[ApexByte],
Expand All @@ -54,7 +52,6 @@ pub(crate) mod basic {
/// # Safety
///
/// This function is safe, as long as the `message` can hold whatever is read
#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
unsafe fn read_blackboard(
blackboard_id: BlackboardId,
time_out: ApexSystemTime,
Expand All @@ -65,14 +62,12 @@ pub(crate) mod basic {
///
/// # Errors
/// - [ErrorReturnCode::InvalidParam]: blackboard with `blackboard_id` does not exist
#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
fn clear_blackboard(blackboard_id: BlackboardId) -> Result<(), ErrorReturnCode>;

/// APEX653P1-5 3.7.2.2.5
///
/// # Errors
/// - [ErrorReturnCode::InvalidConfig]: blackboard with `blackboard_name` does not exist
#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
fn get_blackboard_id(
blackboard_name: BlackboardName,
) -> Result<BlackboardId, ErrorReturnCode>;
Expand All @@ -81,7 +76,6 @@ pub(crate) mod basic {
///
/// # Errors
/// - [ErrorReturnCode::InvalidParam]: blackboard with `blackboard_id` does not exist
#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
fn get_blackboard_status(
blackboard_id: BlackboardId,
) -> Result<BlackboardStatus, ErrorReturnCode>;
Expand Down
5 changes: 0 additions & 5 deletions src/apex/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ pub mod basic {
/// - [ErrorReturnCode::InvalidParam]: `max_message_size` is zero
/// - [ErrorReturnCode::InvalidParam]: `max_nb_message` is too large
/// - [ErrorReturnCode::InvalidMode]: our current operating mode is [OperatingMode::Normal](crate::prelude::OperatingMode::Normal)
#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
fn create_buffer(
buffer_name: BufferName,
max_message_size: MessageSize,
Expand All @@ -41,7 +40,6 @@ pub mod basic {
/// - [ErrorReturnCode::InvalidMode]: current process is error handler AND `time_out` is not instant.
/// - [ErrorReturnCode::NotAvailable]: there is no place in the buffer
/// - [ErrorReturnCode::TimedOut]: `time_out` elapsed
#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
fn send_buffer(
buffer_id: BufferId,
message: &[ApexByte],
Expand All @@ -61,7 +59,6 @@ pub mod basic {
/// # Safety
///
/// This function is safe, as long as the `message` can hold whatever is received
#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
unsafe fn receive_buffer(
buffer_id: BufferId,
time_out: ApexSystemTime,
Expand All @@ -72,14 +69,12 @@ pub mod basic {
///
/// # Errors
/// - [ErrorReturnCode::InvalidConfig]: buffer with `buffer_name` does not exist
#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
fn get_buffer_id(buffer_name: BufferName) -> Result<BufferId, ErrorReturnCode>;

/// APEX653P1-5 3.7.2.1.5
///
/// # Errors
/// - [ErrorReturnCode::InvalidParam]: buffer with `buffer_id` does not exist
#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
fn get_buffer_status(buffer_id: BufferId) -> Result<BufferStatus, ErrorReturnCode>;
}

Expand Down
5 changes: 0 additions & 5 deletions src/apex/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,13 @@ pub mod basic {
///
/// # Errors
/// - [ErrorReturnCode::InvalidParam]: `message` is too large
#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
fn report_application_message(message: &[ApexByte]) -> Result<(), ErrorReturnCode>;

/// APEX653P4 3.8.2.4 trigger error handler process
///
/// # Errors
/// - [ErrorReturnCode::InvalidParam]: `message` is larger than [MAX_ERROR_MESSAGE_SIZE]
/// - [ErrorReturnCode::InvalidParam]: `error_code` is not [ErrorCode::ApplicationError]
#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
fn raise_application_error(
error_code: ErrorCode,
message: &[ApexByte],
Expand All @@ -85,7 +83,6 @@ pub mod basic {
/// - [ErrorReturnCode::InvalidConfig]: not enough memory is available
/// - [ErrorReturnCode::InvalidConfig]: `stack_size` is too large
/// - [ErrorReturnCode::InvalidMode]: our current operating mode is [OperatingMode::Normal](crate::prelude::OperatingMode::Normal)
#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
fn create_error_handler(
entry_point: SystemAddress,
stack_size: StackSize,
Expand All @@ -96,15 +93,13 @@ pub mod basic {
/// # Errors
/// - [ErrorReturnCode::InvalidConfig]: the calling process is not an error handler
/// - [ErrorReturnCode::NoAction]: no error exists right now
#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
fn get_error_status() -> Result<ErrorStatus, ErrorReturnCode>;

/// APEX653P1-5 3.8.2.5
///
/// # Errors
/// - [ErrorReturnCode::InvalidConfig]: no error handler exists
/// - [ErrorReturnCode::InvalidMode]: our current operating mode is [OperatingMode::Normal](crate::prelude::OperatingMode::Normal)
#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
fn configure_error_handler(
concurrency_control: ErrorHandlerConcurrencyControl,
processor_core_id: ProcessorCoreId,
Expand Down
6 changes: 0 additions & 6 deletions src/apex/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,18 @@ pub mod basic {
/// - [ErrorReturnCode::InvalidConfig]: [ApexLimits::SYSTEM_LIMIT_NUMBER_OF_EVENTS](crate::apex::limits::ApexLimits::SYSTEM_LIMIT_NUMBER_OF_EVENTS) was reached
/// - [ErrorReturnCode::NoAction]: an event with given `event_name` already exists
/// - [ErrorReturnCode::InvalidMode]: our current operating mode is [OperatingMode::Normal](crate::prelude::OperatingMode::Normal)
#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
fn create_event(event_name: EventName) -> Result<EventId, ErrorReturnCode>;

/// APEX653P1-5 3.7.2.4.2 changes events state to [EventState::Up]
///
/// # Errors
/// - [ErrorReturnCode::InvalidParam]: event with `event_id` does not exist
#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
fn set_event(event_id: EventId) -> Result<(), ErrorReturnCode>;

/// APEX653P1-5 3.7.2.4.3 changes events state to [EventState::Down]
///
/// # Errors
/// - [ErrorReturnCode::InvalidParam]: event with `event_id` does not exist
#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
fn reset_event(event_id: EventId) -> Result<(), ErrorReturnCode>;

/// APEX653P1-5 3.7.2.4.4
Expand All @@ -68,21 +65,18 @@ pub mod basic {
/// - [ErrorReturnCode::InvalidMode]: current process is error handler AND `time_out` is not instant.
/// - [ErrorReturnCode::NotAvailable]: `time_out` is instant AND event is [EventState::Down]
/// - [ErrorReturnCode::TimedOut]: `time_out` elapsed
#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
fn wait_event(event_id: EventId, time_out: ApexSystemTime) -> Result<(), ErrorReturnCode>;

/// APEX653P1-5 3.7.2.4.5
///
/// # Errors
/// - [ErrorReturnCode::InvalidConfig]: event with `event_name` does not exist
#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
fn get_event_id(event_name: EventName) -> Result<EventId, ErrorReturnCode>;

/// APEX653P1-5 3.7.2.4.6
///
/// # Errors
/// - [ErrorReturnCode::InvalidParam]: event with `event_id` does not exist
#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
fn get_event_status(event_id: EventId) -> Result<EventStatus, ErrorReturnCode>;
}
}
Expand Down
1 change: 0 additions & 1 deletion src/apex/memory_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ pub mod basic {
///
/// # Errors
/// - [ErrorReturnCode::InvalidConfig]: memory block with `memory_block_name` does not exist
#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
fn get_memory_block_status(
memory_block_name: MemoryBlockName,
) -> Result<ApexMemoryBlockStatus, ErrorReturnCode>;
Expand Down
7 changes: 0 additions & 7 deletions src/apex/mutex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ pub mod basic {
/// - [ErrorReturnCode::InvalidParam]: `mutex_priority` is invalid
/// - [ErrorReturnCode::InvalidParam]: [QueuingDiscipline](crate::apex::types::basic::QueuingDiscipline) in `queuing_discipline` is unsupported
/// - [ErrorReturnCode::InvalidMode]: our current operating mode is [OperatingMode::Normal](crate::prelude::OperatingMode::Normal)
#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
fn create_mutex(
mutex_name: MutexName,
mutex_priority: Priority,
Expand All @@ -72,25 +71,19 @@ pub mod basic {
/// - [ErrorReturnCode::NotAvailable]:
/// - [ErrorReturnCode::TimedOut]: `time_out` elapsed
/// - [ErrorReturnCode::InvalidConfig]: lock count of given mutex is at [MAX_LOCK_LEVEL](crate::apex::process::basic::MAX_LOCK_LEVEL)
#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
fn acquire_mutex(
mutex_id: MutexId,
time_out: ApexSystemTime,
) -> Result<(), ErrorReturnCode>;

#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
fn release_mutex(mutex_id: MutexId) -> Result<(), ErrorReturnCode>;

#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
fn reset_mutex(mutex_id: MutexId, process_id: ProcessId) -> Result<(), ErrorReturnCode>;

#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
fn get_mutex_id(mutex_name: MutexName) -> Result<MutexId, ErrorReturnCode>;

#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
fn get_mutex_status(mutex_id: MutexId) -> Result<MutexStatus, ErrorReturnCode>;

#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
fn get_process_mutex_state(process_id: ProcessId) -> Result<MutexId, ErrorReturnCode>;
}
}
Expand Down
2 changes: 0 additions & 2 deletions src/apex/partition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,8 @@ pub mod basic {

pub trait ApexPartitionP4 {
// As stated in ARINC653P1-5 3.2.2.1, this never fails
#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
fn get_partition_status() -> ApexPartitionStatus;

#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
fn set_partition_mode(operating_mode: OperatingMode) -> Result<(), ErrorReturnCode>;
}
}
Expand Down
17 changes: 0 additions & 17 deletions src/apex/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,64 +93,47 @@ pub mod basic {
/// - [ErrorReturnCode::InvalidParam]: `attributes.time_capacity` is invalid
/// - [ErrorReturnCode::InvalidParam]: `attributes.period` is positive and `attributes.period` is less than `attributes.time_capacity`
/// - [ErrorReturnCode::InvalidMode]: our current operating mode is [OperatingMode::Normal](crate::prelude::OperatingMode::Normal)
#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
fn create_process(attributes: &ApexProcessAttribute) -> Result<ProcessId, ErrorReturnCode>;

#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
fn start(process_id: ProcessId) -> Result<(), ErrorReturnCode>;
}

pub trait ApexProcessP1: ApexProcessP4 {
#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
fn set_priority(process_id: ProcessId, priority: Priority) -> Result<(), ErrorReturnCode>;

#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
fn suspend_self(time_out: ApexSystemTime) -> Result<(), ErrorReturnCode>;

#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
fn suspend(process_id: ProcessId) -> Result<(), ErrorReturnCode>;

#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
fn resume(process_id: ProcessId) -> Result<(), ErrorReturnCode>;

#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
fn stop_self();

#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
fn stop(process_id: ProcessId) -> Result<(), ErrorReturnCode>;

#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
fn delayed_start(
process_id: ProcessId,
delay_time: ApexSystemTime,
) -> Result<(), ErrorReturnCode>;

#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
fn lock_preemption() -> Result<LockLevel, ErrorReturnCode>;

#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
fn unlock_preemption() -> Result<LockLevel, ErrorReturnCode>;

#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
fn get_my_id() -> Result<ProcessId, ErrorReturnCode>;

#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
fn get_process_id(process_name: ProcessName) -> Result<ProcessId, ErrorReturnCode>;

#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
fn get_process_status(process_id: ProcessId) -> Result<ApexProcessStatus, ErrorReturnCode>;

// Only during Warm/Cold-Start
#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
fn initialize_process_core_affinity(
process_id: ProcessId,
processor_core_id: ProcessorCoreId,
) -> Result<(), ErrorReturnCode>;

#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
fn get_my_processor_core_id() -> ProcessorCoreId;

#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
fn get_my_index() -> Result<ProcessIndex, ErrorReturnCode>;
}
}
Expand Down
6 changes: 0 additions & 6 deletions src/apex/queuing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ pub mod basic {

pub trait ApexQueuingPortP4 {
// Only during Warm/Cold-Start
#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
fn create_queuing_port(
queuing_port_name: QueuingPortName,
max_message_size: MessageSize,
Expand All @@ -31,7 +30,6 @@ pub mod basic {
queuing_discipline: QueuingDiscipline,
) -> Result<QueuingPortId, ErrorReturnCode>;

#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
fn send_queuing_message(
queuing_port_id: QueuingPortId,
message: &[ApexByte],
Expand All @@ -41,24 +39,20 @@ pub mod basic {
/// # Safety
///
/// This function is safe, as long as the buffer can hold whatever is received
#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
unsafe fn receive_queuing_message(
queuing_port_id: QueuingPortId,
time_out: ApexSystemTime,
message: &mut [ApexByte],
) -> Result<MessageSize, ErrorReturnCode>;

#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
fn get_queuing_port_status(
queuing_port_id: QueuingPortId,
) -> Result<QueuingPortStatus, ErrorReturnCode>;

#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
fn clear_queuing_port(queuing_port_id: QueuingPortId) -> Result<(), ErrorReturnCode>;
}

pub trait ApexQueuingPortP1: ApexQueuingPortP4 {
#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
fn get_queuing_port_id(
queuing_port_name: QueuingPortName,
) -> Result<QueuingPortId, ErrorReturnCode>;
Expand Down
5 changes: 0 additions & 5 deletions src/apex/sampling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,13 @@ pub mod basic {

pub trait ApexSamplingPortP4 {
// Only during Warm/Cold-Start
#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
fn create_sampling_port(
sampling_port_name: SamplingPortName,
max_message_size: MessageSize,
port_direction: PortDirection,
refresh_period: ApexSystemTime,
) -> Result<SamplingPortId, ErrorReturnCode>;

#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
fn write_sampling_message(
sampling_port_id: SamplingPortId,
message: &[ApexByte],
Expand All @@ -49,20 +47,17 @@ pub mod basic {
/// # Safety
///
/// This function is safe, as long as the buffer can hold whatever is received
#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
unsafe fn read_sampling_message(
sampling_port_id: SamplingPortId,
message: &mut [ApexByte],
) -> Result<(Validity, MessageSize), ErrorReturnCode>;
}

pub trait ApexSamplingPortP1: ApexSamplingPortP4 {
#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
fn get_sampling_port_id(
sampling_port_name: SamplingPortName,
) -> Result<SamplingPortId, ErrorReturnCode>;

#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
fn get_sampling_port_status(
sampling_port_id: SamplingPortId,
) -> Result<ApexSamplingPortStatus, ErrorReturnCode>;
Expand Down
3 changes: 0 additions & 3 deletions src/apex/schedules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,8 @@ pub mod basic {
pub type ScheduleId = ApexLongInteger;

pub trait ApexScheduleP2 {
#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
fn set_module_schedule(schedule_id: ScheduleId) -> Result<(), ErrorReturnCode>;
#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
fn get_module_schedule_status() -> Result<ApexScheduleStatus, ErrorReturnCode>;
#[cfg_attr(not(feature = "full_doc"), doc(hidden))]
fn get_module_schedule_id(
schedule_name: ScheduleName,
) -> Result<ScheduleId, ErrorReturnCode>;
Expand Down
Loading

0 comments on commit da5bf63

Please sign in to comment.