pub mod reject_code;
mod upstream;
pub use crate::__platform_println as println;
#[cfg(feature = "cdk")]
pub use ic_platform_macros::{
heartbeat, init, inspect_message, on_low_wasm_memory, post_upgrade, pre_upgrade, query, update,
};
pub mod api {
pub use super::upstream::api::{
PerformanceCounterType, SignCostError, accept_message, call_context_instruction_counter,
canister_cycle_balance, canister_liquid_cycle_balance, canister_self, canister_version,
certified_data_set, cost_call, cost_create_canister, cost_http_request,
cost_sign_with_ecdsa, cycles_burn, data_certificate, debug_print, global_timer_set,
in_replicated_execution, instruction_counter, is_controller, msg_arg_data, msg_caller,
msg_cycles_accept, msg_cycles_available, msg_cycles_refunded, msg_method_name, msg_reject,
msg_reply, performance_counter, root_key, stable_size, subnet_self, time, trap,
};
}
pub mod call {
pub use super::upstream::call::{
Call, CallFailed, CallPerformFailed, CallRejected, InsufficientLiquidCycleBalance,
OnewayError, RejectCode, Response, UnrecognizedRejectCode, WaitPolicy,
};
}
pub mod stable {
pub use super::upstream::stable::{StableMemoryError, stable_grow, stable_read, stable_write};
}
pub mod futures {
pub use super::upstream::futures::{
is_recovering_from_trap, spawn, spawn_migratory, spawn_weak,
};
pub mod internals {
pub use super::super::upstream::futures::internals::{
in_executor_context, in_query_executor_context,
};
}
}
#[doc(hidden)]
#[macro_export]
macro_rules! __platform_println {
($fmt:expr) => {{
#[cfg(target_family = "wasm")]
$crate::cdk::api::debug_print(format!($fmt));
#[cfg(not(target_family = "wasm"))]
std::println!($fmt);
}};
($fmt:expr, $($arg:tt)*) => {{
#[cfg(target_family = "wasm")]
$crate::cdk::api::debug_print(format!($fmt, $($arg)*));
#[cfg(not(target_family = "wasm"))]
std::println!($fmt, $($arg)*);
}};
}