pub struct StandaloneCanisterFixture { /* private fields */ }Expand description
One caller-built PocketIC instance/server owner and one installed canister.
This fixture retains the instance and its optional managed server together. It does not impose process-wide synchronization or hide PocketIC methods.
Implementations§
Source§impl StandaloneCanisterFixture
impl StandaloneCanisterFixture
Sourcepub fn install(instance: PocketIcInstance<PocketIc>, spec: InstallSpec) -> Self
pub fn install(instance: PocketIcInstance<PocketIc>, spec: InstallSpec) -> Self
Install one canister into a caller-configured PocketIC instance.
§Panics
Panics with the contextual install error when installation fails.
Sourcepub fn try_install(
instance: PocketIcInstance<PocketIc>,
spec: InstallSpec,
) -> Result<Self, StandaloneCanisterInstallError>
pub fn try_install( instance: PocketIcInstance<PocketIc>, spec: InstallSpec, ) -> Result<Self, StandaloneCanisterInstallError>
Fallible counterpart to install.
On failure, the error retains both the caller’s instance/server ownership record and the structured install failure.
Sourcepub const fn pocket_ic(&self) -> &PocketIc
pub const fn pocket_ic(&self) -> &PocketIc
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) -> (PocketIcInstance<PocketIc>, Principal)
pub fn into_parts(self) -> (PocketIcInstance<PocketIc>, Principal)
Consume the fixture and return the instance/server ownership record and canister id.
Auto Trait Implementations§
impl !RefUnwindSafe for StandaloneCanisterFixture
impl !UnwindSafe for StandaloneCanisterFixture
impl Freeze for StandaloneCanisterFixture
impl Send for StandaloneCanisterFixture
impl Sync for StandaloneCanisterFixture
impl Unpin for StandaloneCanisterFixture
impl UnsafeUnpin for StandaloneCanisterFixture
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more