pub struct StandaloneCanisterFixture { /* private fields */ }Expand description
StandaloneCanisterFixture
Implementations§
Source§impl StandaloneCanisterFixture
impl StandaloneCanisterFixture
Sourcepub const fn pic(&self) -> &Pic
pub const fn pic(&self) -> &Pic
Borrow the PocketIC instance that owns this standalone fixture.
Sourcepub const fn pic_mut(&mut self) -> &mut Pic
pub const fn pic_mut(&mut self) -> &mut Pic
Mutably borrow the PocketIC instance that owns this standalone fixture.
Sourcepub const fn canister_id(&self) -> Principal
pub const fn canister_id(&self) -> Principal
Read the installed canister id for this standalone fixture.
Sourcepub fn into_parts(self) -> (Pic, Principal)
pub fn into_parts(self) -> (Pic, Principal)
Consume the fixture and return the owned PocketIC instance and canister id.
Sourcepub fn update_call<T, A>(
&self,
method: &str,
args: A,
) -> Result<T, PicCallError>
pub fn update_call<T, A>( &self, method: &str, args: A, ) -> Result<T, PicCallError>
Forward one typed update call to this fixture’s canister id.
Sourcepub fn update_call_or_panic<T, A>(&self, method: &str, args: A) -> T
pub fn update_call_or_panic<T, A>(&self, method: &str, args: A) -> T
Forward one typed update call to this fixture’s canister id, panicking on transport or Candid codec failure.
This does not unwrap application-level results. For example,
update_call_or_panic::<Result<T, E>, _>(...) returns Result<T, E>.
Sourcepub fn update_call_as<T, A>(
&self,
caller: Principal,
method: &str,
args: A,
) -> Result<T, PicCallError>
pub fn update_call_as<T, A>( &self, caller: Principal, method: &str, args: A, ) -> Result<T, PicCallError>
Forward one typed update call with an explicit caller to this fixture’s canister id.
Sourcepub fn update_call_as_or_panic<T, A>(
&self,
caller: Principal,
method: &str,
args: A,
) -> T
pub fn update_call_as_or_panic<T, A>( &self, caller: Principal, method: &str, args: A, ) -> T
Forward one typed update call with an explicit caller to this fixture’s canister id, panicking on transport or Candid codec failure.
This does not unwrap application-level results. For example,
update_call_as_or_panic::<Result<T, E>, _>(...) returns Result<T, E>.
Sourcepub fn query_call<T, A>(&self, method: &str, args: A) -> Result<T, PicCallError>
pub fn query_call<T, A>(&self, method: &str, args: A) -> Result<T, PicCallError>
Forward one typed query call to this fixture’s canister id.
Sourcepub fn query_call_or_panic<T, A>(&self, method: &str, args: A) -> T
pub fn query_call_or_panic<T, A>(&self, method: &str, args: A) -> T
Forward one typed query call to this fixture’s canister id, panicking on transport or Candid codec failure.
This does not unwrap application-level results. For example,
query_call_or_panic::<Result<T, E>, _>(...) returns Result<T, E>.
Sourcepub fn query_call_as<T, A>(
&self,
caller: Principal,
method: &str,
args: A,
) -> Result<T, PicCallError>
pub fn query_call_as<T, A>( &self, caller: Principal, method: &str, args: A, ) -> Result<T, PicCallError>
Forward one typed query call with an explicit caller to this fixture’s canister id.
Sourcepub fn query_call_as_or_panic<T, A>(
&self,
caller: Principal,
method: &str,
args: A,
) -> T
pub fn query_call_as_or_panic<T, A>( &self, caller: Principal, method: &str, args: A, ) -> T
Forward one typed query call with an explicit caller to this fixture’s canister id, panicking on transport or Candid codec failure.
This does not unwrap application-level results. For example,
query_call_as_or_panic::<Result<T, E>, _>(...) returns Result<T, E>.