Struct sequoia_ipc::Config
source · pub struct Config(/* private fields */);
Expand description
Represents a Context
configuration.
A context can be configured using the builder pattern with
Context::configure
:
let c = Context::configure()
.ipc_policy(IPCPolicy::Robust)
.build()?;
You can create ephemeral context that are useful for tests and one-shot programs:
let c = Context::configure().ephemeral().build()?;
let ephemeral_home = c.home().to_path_buf();
// Do some tests.
drop(c);
assert!(! ephemeral_home.exists());
Implementations§
source§impl Config
impl Config
sourcepub fn set_home<P: AsRef<Path>>(&mut self, home: P) -> PathBuf
pub fn set_home<P: AsRef<Path>>(&mut self, home: P) -> PathBuf
Sets the directory containing shared state.
sourcepub fn lib<P: AsRef<Path>>(self, lib: P) -> Self
pub fn lib<P: AsRef<Path>>(self, lib: P) -> Self
Sets the directory containing backend servers.
sourcepub fn set_lib<P: AsRef<Path>>(&mut self, lib: P) -> PathBuf
pub fn set_lib<P: AsRef<Path>>(&mut self, lib: P) -> PathBuf
Sets the directory containing backend servers.
sourcepub fn ipc_policy(self, policy: IPCPolicy) -> Self
pub fn ipc_policy(self, policy: IPCPolicy) -> Self
Sets the IPC policy.
sourcepub fn set_ipc_policy(&mut self, policy: IPCPolicy) -> IPCPolicy
pub fn set_ipc_policy(&mut self, policy: IPCPolicy) -> IPCPolicy
Sets the IPC policy.
sourcepub fn set_ephemeral(&mut self) -> bool
pub fn set_ephemeral(&mut self) -> bool
Makes this context ephemeral.
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
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