pub struct CachedPocketIcBaseline<T> { /* private fields */ }Expand description
One owned PocketIC instance with captured snapshots and caller metadata.
The value contains no global synchronization. Callers choose the specific
Mutex slot passed to restore_or_rebuild_cached_pocket_ic_baseline.
Implementations§
Source§impl<T> CachedPocketIcBaseline<T>
impl<T> CachedPocketIcBaseline<T>
Sourcepub fn capture<I>(
pocket_ic: PocketIc,
controller_id: Principal,
canister_ids: I,
metadata: T,
) -> Result<Self, ControllerSnapshotError>where
I: IntoIterator<Item = Principal>,
pub fn capture<I>(
pocket_ic: PocketIc,
controller_id: Principal,
canister_ids: I,
metadata: T,
) -> Result<Self, ControllerSnapshotError>where
I: IntoIterator<Item = Principal>,
Capture one cached baseline from the current PocketIC instance.
Snapshot capture is ordered and transactional as documented by
PocketIcSnapshotExt::capture_controller_snapshots.
Sourcepub fn restore(
&self,
controller_id: Principal,
) -> Result<(), ControllerSnapshotError>
pub fn restore( &self, controller_id: Principal, ) -> Result<(), ControllerSnapshotError>
Restore the captured snapshot set without adding cycles.
Sourcepub fn restore_with_funding(
&self,
controller_id: Principal,
funding: SnapshotRestoreFunding,
) -> Result<(), ControllerSnapshotError>
pub fn restore_with_funding( &self, controller_id: Principal, funding: SnapshotRestoreFunding, ) -> Result<(), ControllerSnapshotError>
Restore the captured snapshot set with an explicit cycle-funding policy.
Sourcepub const fn pocket_ic(&self) -> &PocketIc
pub const fn pocket_ic(&self) -> &PocketIc
Borrow the owned PocketIC instance behind this cached baseline.
Sourcepub const fn metadata(&self) -> &T
pub const fn metadata(&self) -> &T
Borrow the captured metadata associated with this cached baseline.
Sourcepub const fn metadata_mut(&mut self) -> &mut T
pub const fn metadata_mut(&mut self) -> &mut T
Mutably borrow the captured metadata associated with this cached baseline.
Auto Trait Implementations§
impl<T> !RefUnwindSafe for CachedPocketIcBaseline<T>
impl<T> !UnwindSafe for CachedPocketIcBaseline<T>
impl<T> Freeze for CachedPocketIcBaseline<T>where
T: Freeze,
impl<T> Send for CachedPocketIcBaseline<T>where
T: Send,
impl<T> Sync for CachedPocketIcBaseline<T>where
T: Sync,
impl<T> Unpin for CachedPocketIcBaseline<T>where
T: Unpin,
impl<T> UnsafeUnpin for CachedPocketIcBaseline<T>where
T: UnsafeUnpin,
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