Skip to main content

Module pic

Module pic 

Source
Expand description

Direct PocketIC types plus value-adding host-test harness extensions.

The complete upstream crate is available through crate::pocket_ic. This module keeps the common runtime types alongside ic-testkit’s focused extension traits and policy types.

Construct and own PocketIc instances normally, then import individual extension traits or prelude for Candid calls, installation, diagnostics, snapshots, fallible startup, bounded predicate polling and nanosecond time conversion. Native simulator operations remain upstream inherent methods.

PocketIcManagedServer can explicitly own one exact caller-selected server child for a serial suite. No type serializes independent instances or owns PocketIC’s server download/cache policy.

Modules§

prelude
All PocketIC extension traits, and no data types.

Structs§

BaselinePoolTimings
Timings for one baseline-pool acquisition.
CachedPocketIcBaseline
One owned PocketIC instance with captured snapshots and caller metadata.
CachedPocketIcBaselinePool
Caller-owned runtime-capacity pool of independently restorable PocketIC baselines.
CachedPocketIcBaselinePoolGuard
Exclusive lease of one validated pooled PocketIC baseline.
CachedStandaloneCanisterFixtureGuard
Exclusive lease of one independently restored standalone fixture.
CachedStandaloneCanisterFixturePool
Caller-owned runtime-capacity pool of independently restorable standalone fixtures.
CandidCallContext
Stable call metadata attached to a contextual call failure.
CandidCallError
Structured failure from a super::CandidCallExt operation.
CanisterDiagnosticLogRecord
One canister-log record retained as bounded lossy UTF-8 text.
CanisterDiagnosticLogs
Successfully fetched canister logs after bounded text conversion.
CanisterDiagnosticsBatchEntry
One ordered labeled entry in a collect-all diagnostics batch.
CanisterDiagnosticsBatchReport
Ordered entries from a sequential collect-all diagnostics batch.
CanisterDiagnosticsReport
Independent status and log outcomes for one diagnostic collection.
CanisterDiagnosticsRequest
Exact controller-aware inputs for one best-effort diagnostic collection.
CanisterInstallError
Failed creation, funding, or installation with its original operation error.
CanisterLogRenderLimits
Explicit bounds applied when canister logs are converted to diagnostic text.
CanisterRestoreReceipt
Receipt for restoring the recipe’s captured canister set.
CanisterSnapshotTarget
One canister and exact management-call sender used for snapshot capture.
CanisterStatusResult
Canister Status Result
ControllerSnapshots
Deterministically ordered snapshots retaining each successful capture sender.
FixtureRecipeId
Caller-owned stable identity for one pooled fixture recipe.
InstallSpec
Inputs and diagnostic context for one generic canister installation.
LabeledCanisterDiagnosticsRequest
One caller-labeled exact diagnostic request in a collect-all batch.
PocketIc
Main entry point for interacting with PocketIC.
PocketIcBuilder
PocketIcManagedServer
Caller-owned PocketIC server process with bounded startup and output capture.
PocketIcManagedServerOutput
Bounded lossy UTF-8 output captured from a managed PocketIC server.
PocketIcOperationError
Captured PocketIC operation failure, retaining transport classification.
PocketIcStartupConfig
Explicit bounded source and policy for one PocketIC startup.
ReadinessReceipt
Receipt identifying the readiness boundary reached after reset.
RejectResponse
User-facing type describing an unsuccessful (also called reject) call response.
ResetReceipt
Typed reset guarantees achieved by one preparation pass.
ResetRequirements
Typed reset guarantees required by one fixture recipe.
RetryPolicy
Retry limits and simulated cooldown for install-code operations.
SnapshotAttemptFailure
One rejected sender attempt for a snapshot operation.
SnapshotCleanupFailure
Failure to remove a snapshot while rolling back a partial capture.
StandaloneCanisterFixture
One caller-built PocketIC instance and one installed canister.
StandaloneCanisterInstallError
Failed standalone install retaining the caller-created PocketIC instance.
StandaloneFixturePoolTimings
Timings for one standalone fixture-pool acquisition.
ValidationReceipt
Receipt proving the recipe’s final invariant validation ran successfully.

Enums§

BaselinePoolContractError
Contract failure while constructing or verifying recipe reset evidence.
BaselinePoolError
Failure to acquire a validated baseline-pool lease.
BaselinePoolOutcome
Whether a baseline-pool lease was built, restored, or rebuilt.
BaselinePoolPreparationError
One failed recipe or contract stage while preparing a baseline slot.
BaselinePreparationStage
Recipe stage associated with a structured preparation failure.
CandidCallErrorKind
High-level Candid call failure classification.
CanisterDiagnosticFailure
A failed best-effort PocketIC diagnostic call.
CanisterDiagnosticsBatchContractError
Structural error that prevents a diagnostics batch from starting.
CanisterInstallPhase
Stage at which a canister creation and installation failed.
ControllerSnapshotError
Structured controller-snapshot failure.
CycleResetPolicy
Cycle handling required or achieved by one reset.
ErrorCode
User-facing error codes.
ExtraCanisterPolicy
Extra-canister handling required or achieved by one reset.
FailureDisposition
Recipe decision for a failed restored-slot preparation stage.
PocketIcStartupError
Structured failure from bounded PocketIC construction.
PreparedBaseline
Whether validation is observing a newly built or restored baseline.
RebuildReason
Why an invalid or failed slot was reconstructed.
RejectCode
User-facing reject codes.
ResetDomainKind
Reset domain whose handling is declared by a pooled baseline recipe.
ResetDomainPolicy
Policy for one non-snapshot reset domain.
RetryPolicyError
Invalid install-code retry policy configuration.
SnapshotRestoreFunding
Caller-selected cycle funding applied immediately before snapshot restore.
StandaloneFixturePoolError
Failure to acquire a standalone fixture-pool lease with structured diagnostics.
StandaloneFixturePoolOutcome
Whether a standalone fixture-pool lease was built, restored, or rebuilt.
StandaloneFixturePoolRebuildReason
Why a standalone fixture-pool slot was rebuilt.
StandaloneFixturePoolStage
Standalone fixture preparation stage associated with a snapshot failure.
StateResetPolicy
Generic handling for reset domains without a more specific policy.
TickUntilError
A caller-owned readiness check failed or exhausted its simulated round budget.
TimeResetPolicy
PocketIC time handling required or achieved by one reset.

Constants§

DEFAULT_CANISTER_LOG_BYTE_LIMIT
Default maximum aggregate raw canister-log bytes retained in diagnostics.
DEFAULT_CANISTER_LOG_RECORD_LIMIT
Default maximum number of canister-log records retained in diagnostics.
LATEST_SERVER_VERSION
Public to facilitate downloading the PocketIC server.

Traits§

CandidCallExt
Typed Candid calls with contextual encoding, rejection, and decoding errors.
CanisterInstallExt
Generic canister installation and structured install-code retry policy.
PocketIcBaselineRecipe
Complete caller-owned lifecycle recipe for one pooled PocketIC baseline.
PocketIcBuilderExt
Fallible construction at PocketIC’s panicking builder boundary.
PocketIcDiagnosticsExt
Reusable structured PocketIC failure diagnostics.
PocketIcSnapshotExt
Controller-aware capture and restore of related canister snapshots.
PocketIcTimeExt
Focused time conversion missing from PocketIC’s native API.

Functions§

is_dead_pocket_ic_transport_error
Recognize PocketIC transport failures in typed causes and request-error text.
tick_until
Check a caller-owned predicate, advancing simulated time and ticking while pending.