use crate::{
state::{
kernel_dispatch, KernelError, KernelRequest, KernelResult, KernelStateCore, PluginMeta,
ResourceMeta,
},
state::{ActorError, ActorRuntime, Message},
state::{
DomainScheduleEntry,
FaultType,
IPCBlockReason,
IdleThreadEntry,
KernelEntryReason,
ReadyQueueEntry,
Registers,
ReleaseQueueEntry,
SchedulerAction,
SchedulerState,
ThreadState,
TCB,
},
state::{
Edge, NodeState, NodeStateEntry, RetryEntry, WorkflowDef, WorkflowError, WorkflowInstance,
WorkflowStatus,
},
state::{MemoryError, PluginError, PluginLocal, ResourceStatus},
state::{ResourceInfo, StateError},
step::{AuthorizationError, Authorized, HostCall, HostFunction, HostResult, KernelOp},
step::{PluginInternal, ResourceType, Step},
Action,
Blake3Hash,
CapPayload,
Capability,
CapabilityError,
Hash32,
Key,
LogEvent,
MemRegion,
MsgState,
PolicyContext,
PolicyDecision,
PolicyDecisionFn,
PolicyError,
PolicyState,
Right,
Rights,
RightsError,
SealedTag,
SecurityLevel,
SymbolicTag,
};
#[allow(dead_code)]
#[allow(clippy::needless_pass_by_value)]
pub fn export_types(
_security_level: SecurityLevel,
_key: Key,
_sealed_tag: SealedTag,
_hash32: Hash32,
_blake3: Blake3Hash,
_symbolic: SymbolicTag,
_cap_payload: CapPayload,
_capability: Capability,
_log_event: LogEvent,
_cap_error: CapabilityError,
_right: Right,
_rights: Rights,
_rights_error: RightsError,
_mem_region: MemRegion,
_msg_state: MsgState,
_action: Action,
_policy_ctx: PolicyContext,
_policy_decision: PolicyDecision,
_policy_decision_fn: PolicyDecisionFn,
_policy_state: PolicyState,
_kernel_state_core: KernelStateCore,
_plugin_meta: PluginMeta,
_resource_meta: ResourceMeta,
_kernel_request: KernelRequest,
_kernel_error: KernelError,
_message: Message,
_actor_error: ActorError,
_host_function: HostFunction,
_host_call: HostCall,
_host_result: HostResult,
_workflow_status: WorkflowStatus,
_node_state: NodeState,
_edge: Edge,
_node_state_entry: NodeStateEntry,
_retry_entry: RetryEntry,
_workflow_def: WorkflowDef,
_workflow_instance: WorkflowInstance,
_policy_error: PolicyError,
_kernel_op: KernelOp,
_auth_error: AuthorizationError,
_actor_runtime: ActorRuntime,
_thread_state: ThreadState,
_ipc_block_reason: IPCBlockReason,
_fault_type: FaultType,
_registers: Registers,
_tcb: TCB,
_domain_schedule_entry: DomainScheduleEntry,
_scheduler_action: SchedulerAction,
_kernel_entry_reason: KernelEntryReason,
_ready_queue_entry: ReadyQueueEntry,
_release_queue_entry: ReleaseQueueEntry,
_idle_thread_entry: IdleThreadEntry,
_scheduler_state: SchedulerState,
_memory_error: MemoryError,
_plugin_error: PluginError,
_state_error: StateError,
_workflow_error: WorkflowError,
_resource_status: ResourceStatus,
_plugin_local: PluginLocal,
_resource_info: ResourceInfo,
_resource_type: ResourceType,
_plugin_internal: PluginInternal,
_authorized: Authorized,
_step: Step,
) {
}
#[allow(dead_code)]
pub fn export_rights_functions(
rights: Rights,
right: Right,
other_rights: Rights,
) -> (bool, bool, bool, Rights) {
let is_empty = rights.is_empty();
let contains = rights.contains(right);
let is_subset = rights.is_subset_of(&other_rights);
let combined = rights.combine(&other_rights);
(is_empty, contains, is_subset, combined)
}
#[allow(dead_code)]
pub fn export_right_functions(right: Right) -> (u8, Option<Right>) {
let to_u8 = right.to_u8();
let from_u8 = Right::from_u8(to_u8);
(to_u8, from_u8)
}
#[allow(dead_code)]
pub fn export_security_level_functions(level: SecurityLevel) -> u8 {
level.to_u8()
}
#[allow(dead_code)]
pub fn export_capability_functions(cap: Capability, right: Right) -> (CapPayload, bool) {
let payload = cap.payload();
let has_right = cap.has_right(right);
(payload, has_right)
}
#[allow(dead_code)]
pub fn export_hash_functions(hash: Hash32) -> bool {
hash.is_zero()
}
#[allow(dead_code)]
pub fn export_key_functions(key: Key) -> bool {
key.is_empty()
}
#[allow(dead_code)]
pub fn export_kernel_dispatch_functions(core: KernelStateCore, req: KernelRequest) -> KernelResult {
kernel_dispatch(core, req)
}