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

source

pub fn build(self) -> Result<Context>

Finalizes the configuration and returns a Context.

source

pub fn home<P: AsRef<Path>>(self, home: P) -> Self

Sets the directory containing shared state.

source

pub fn set_home<P: AsRef<Path>>(&mut self, home: P) -> PathBuf

Sets the directory containing shared state.

source

pub fn lib<P: AsRef<Path>>(self, lib: P) -> Self

Sets the directory containing backend servers.

source

pub fn set_lib<P: AsRef<Path>>(&mut self, lib: P) -> PathBuf

Sets the directory containing backend servers.

source

pub fn ipc_policy(self, policy: IPCPolicy) -> Self

Sets the IPC policy.

source

pub fn set_ipc_policy(&mut self, policy: IPCPolicy) -> IPCPolicy

Sets the IPC policy.

source

pub fn ephemeral(self) -> Self

Makes this context ephemeral.

source

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V