pub struct PocketIcStartupConfig { /* private fields */ }Expand description
Explicit bounded source and policy for one PocketIC startup.
Implementations§
Source§impl PocketIcStartupConfig
impl PocketIcStartupConfig
Sourcepub fn spawn(server_binary: impl Into<PathBuf>, timeout: Duration) -> Self
pub fn spawn(server_binary: impl Into<PathBuf>, timeout: Duration) -> Self
Spawn and monitor one exact PocketIC server binary.
Startup allocates a unique private temporary directory while leaving
the --port-file path absent for PocketIC to create.
Sourcepub fn connect(server_url: impl Into<String>, timeout: Duration) -> Self
pub fn connect(server_url: impl Into<String>, timeout: Duration) -> Self
Connect to a caller-owned existing PocketIC server.
The URL is applied to the builder explicitly, so this mode never lets the upstream builder spawn a hidden server child.
Sourcepub const fn with_server_hard_ttl(self, hard_ttl: Duration) -> Self
pub const fn with_server_hard_ttl(self, hard_ttl: Duration) -> Self
Set the hard lifetime passed to an ic-testkit-managed server.
Sourcepub const fn server_hard_ttl(&self) -> Duration
pub const fn server_hard_ttl(&self) -> Duration
Managed server hard lifetime.
Sourcepub fn server_binary(&self) -> Option<&Path>
pub fn server_binary(&self) -> Option<&Path>
Managed server binary, when this configuration spawns one.
Sourcepub fn server_url(&self) -> Option<&str>
pub fn server_url(&self) -> Option<&str>
Existing caller-owned server URL, when configured.
Sourcepub fn start_managed_server(
self,
) -> Result<PocketIcManagedServer, PocketIcStartupError>
pub fn start_managed_server( self, ) -> Result<PocketIcManagedServer, PocketIcStartupError>
Start a caller-owned managed server without constructing an instance.
This requires a configuration created by Self::spawn. Readiness is
bounded by Self::timeout, and the configured hard TTL is still
passed to the child. The returned handle terminates the child on drop;
use its URL with Self::connect to construct bounded instances.
Trait Implementations§
Source§impl Clone for PocketIcStartupConfig
impl Clone for PocketIcStartupConfig
Source§fn clone(&self) -> PocketIcStartupConfig
fn clone(&self) -> PocketIcStartupConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PocketIcStartupConfig
impl Debug for PocketIcStartupConfig
impl Eq for PocketIcStartupConfig
Source§impl PartialEq for PocketIcStartupConfig
impl PartialEq for PocketIcStartupConfig
impl StructuralPartialEq for PocketIcStartupConfig
Auto Trait Implementations§
impl Freeze for PocketIcStartupConfig
impl RefUnwindSafe for PocketIcStartupConfig
impl Send for PocketIcStartupConfig
impl Sync for PocketIcStartupConfig
impl Unpin for PocketIcStartupConfig
impl UnsafeUnpin for PocketIcStartupConfig
impl UnwindSafe for PocketIcStartupConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.