Struct ic_kit_runtime::canister::Canister
source · [−]pub struct Canister { /* private fields */ }
Expand description
A canister that is being executed.
Implementations
sourceimpl Canister
impl Canister
sourcepub fn new<T: Into<Principal>>(canister_id: T) -> Self
pub fn new<T: Into<Principal>>(canister_id: T) -> Self
Create a new instance of this canister with the given id.
sourcepub fn with_method<M: CanisterMethod + 'static>(self) -> Self
pub fn with_method<M: CanisterMethod + 'static>(self) -> Self
Provide the canister with the definition of the given method.
sourcepub fn with_stable(self, stable: Box<dyn StableMemoryBackend + Send>) -> Self
pub fn with_stable(self, stable: Box<dyn StableMemoryBackend + Send>) -> Self
Provide the canister with this stable storage backend.
pub async fn process_message(
&mut self,
message: Message,
reply_sender: Option<Sender<CallReply>>
) -> Vec<CanisterCall>
Trait Implementations
sourceimpl Ic0CallHandlerProxy for Canister
impl Ic0CallHandlerProxy for Canister
fn msg_arg_data_size(&mut self) -> Result<isize, String>
fn msg_arg_data_copy(
&mut self,
dst: isize,
offset: isize,
size: isize
) -> Result<(), String>
fn msg_caller_size(&mut self) -> Result<isize, String>
fn msg_caller_copy(
&mut self,
dst: isize,
offset: isize,
size: isize
) -> Result<(), String>
fn msg_reject_code(&mut self) -> Result<i32, String>
fn msg_reject_msg_size(&mut self) -> Result<isize, String>
fn msg_reject_msg_copy(
&mut self,
dst: isize,
offset: isize,
size: isize
) -> Result<(), String>
fn msg_reply_data_append(&mut self, src: isize, size: isize) -> Result<(), String>
fn msg_reply(&mut self) -> Result<(), String>
fn msg_reject(&mut self, src: isize, size: isize) -> Result<(), String>
fn msg_cycles_available(&mut self) -> Result<i64, String>
fn msg_cycles_available128(&mut self, dst: isize) -> Result<(), String>
fn msg_cycles_refunded(&mut self) -> Result<i64, String>
fn msg_cycles_refunded128(&mut self, dst: isize) -> Result<(), String>
fn msg_cycles_accept(&mut self, max_amount: i64) -> Result<i64, String>
fn msg_cycles_accept128(
&mut self,
max_amount_high: i64,
max_amount_low: i64,
dst: isize
) -> Result<(), String>
fn canister_self_size(&mut self) -> Result<isize, String>
fn canister_self_copy(
&mut self,
dst: isize,
offset: isize,
size: isize
) -> Result<(), String>
fn canister_cycle_balance(&mut self) -> Result<i64, String>
fn canister_cycle_balance128(&mut self, dst: isize) -> Result<(), String>
fn canister_status(&mut self) -> Result<i32, String>
fn msg_method_name_size(&mut self) -> Result<isize, String>
fn msg_method_name_copy(
&mut self,
dst: isize,
offset: isize,
size: isize
) -> Result<(), String>
fn accept_message(&mut self) -> Result<(), String>
fn call_new(
&mut self,
callee_src: isize,
callee_size: isize,
name_src: isize,
name_size: isize,
reply_fun: isize,
reply_env: isize,
reject_fun: isize,
reject_env: isize
) -> Result<(), String>
fn call_on_cleanup(&mut self, fun: isize, env: isize) -> Result<(), String>
fn call_data_append(&mut self, src: isize, size: isize) -> Result<(), String>
fn call_cycles_add(&mut self, amount: i64) -> Result<(), String>
fn call_cycles_add128(
&mut self,
amount_high: i64,
amount_low: i64
) -> Result<(), String>
fn call_perform(&mut self) -> Result<i32, String>
fn stable_size(&mut self) -> Result<i32, String>
fn stable_grow(&mut self, new_pages: i32) -> Result<i32, String>
fn stable_write(
&mut self,
_offset: i32,
_src: isize,
_size: isize
) -> Result<(), String>
fn stable_read(
&mut self,
dst: isize,
offset: i32,
size: isize
) -> Result<(), String>
fn stable64_size(&mut self) -> Result<i64, String>
fn stable64_grow(&mut self, new_pages: i64) -> Result<i64, String>
fn stable64_write(
&mut self,
offset: i64,
src: i64,
size: i64
) -> Result<(), String>
fn stable64_read(&mut self, dst: i64, offset: i64, size: i64) -> Result<(), String>
fn certified_data_set(&mut self, _src: isize, _size: isize) -> Result<(), String>
fn data_certificate_present(&mut self) -> Result<i32, String>
fn data_certificate_size(&mut self) -> Result<isize, String>
fn data_certificate_copy(
&mut self,
_dst: isize,
_offset: isize,
_size: isize
) -> Result<(), String>
fn time(&mut self) -> Result<i64, String>
fn performance_counter(&mut self, _counter_type: i32) -> Result<i64, String>
fn debug_print(&mut self, src: isize, size: isize) -> Result<(), String>
fn trap(&mut self, src: isize, size: isize) -> Result<(), String>
Auto Trait Implementations
impl !RefUnwindSafe for Canister
impl Send for Canister
impl !Sync for Canister
impl Unpin for Canister
impl !UnwindSafe for Canister
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more