pub struct MembraneHandle { /* private fields */ }Expand description
Shared, cheaply cloneable access to the located membrane binary.
Implementations§
Source§impl MembraneHandle
impl MembraneHandle
Sourcepub fn connect() -> Self
pub fn connect() -> Self
Locate Pulse’s membrane (env override, notch state, resident file, installed path).
Touches the filesystem only; the binary is verified lazily on first call.
The one process-wide handle: a single discovery and a single membrane where check,
shared by the memory backend, DaemonState.membrane and the transcript exporter.
Sourcepub fn verified_cli(&self) -> Option<MembraneCli>
pub fn verified_cli(&self) -> Option<MembraneCli>
The verified adapter, or None when Pulse is absent or the binary failed verification.
Sourcepub fn backend_arc(&self) -> Arc<dyn MembraneBackend + Send + Sync> ⓘ
pub fn backend_arc(&self) -> Arc<dyn MembraneBackend + Send + Sync> ⓘ
Shareable MembraneBackend: the verified CLI, else Unavailable.
Sourcepub fn from_cli(cli: MembraneCli) -> Self
pub fn from_cli(cli: MembraneCli) -> Self
Use an explicit adapter (custom timeout, test binary).
Sourcepub fn off_reason(&self) -> Option<String>
pub fn off_reason(&self) -> Option<String>
off: pulse not installed, or the verify failure. May run membrane where (bounded).
Sourcepub fn call_blocking<T>(
&self,
f: impl FnOnce(&dyn MembraneBackend) -> Result<T, MembraneError>,
) -> Result<T, MembraneError>
pub fn call_blocking<T>( &self, f: impl FnOnce(&dyn MembraneBackend) -> Result<T, MembraneError>, ) -> Result<T, MembraneError>
Synchronous call, bounded by the adapter’s per-invocation timeout.
Sourcepub async fn call<T, F>(
&self,
context: &CallContext,
mutation: bool,
f: F,
) -> Result<T, MemoryBackendError>where
T: Send + 'static,
F: FnOnce(&dyn MembraneBackend) -> Result<T, MembraneError> + Send + 'static,
pub async fn call<T, F>(
&self,
context: &CallContext,
mutation: bool,
f: F,
) -> Result<T, MemoryBackendError>where
T: Send + 'static,
F: FnOnce(&dyn MembraneBackend) -> Result<T, MembraneError> + Send + 'static,
Async call on the blocking pool, bounded by the context deadline and cancellation.
A timeout or cancellation of a mutation reports CommitUnknown.
Sourcepub async fn context_pull(
&self,
context: &CallContext,
cwd: &Path,
prompt: &str,
budget: Option<usize>,
repo: Option<&Path>,
) -> Result<ContextPull, MemoryBackendError>
pub async fn context_pull( &self, context: &CallContext, cwd: &Path, prompt: &str, budget: Option<usize>, repo: Option<&Path>, ) -> Result<ContextPull, MemoryBackendError>
Bounded async context pull. Pulse absent yields empty text with the off reason.
Trait Implementations§
Auto Trait Implementations§
impl Forget for MembraneHandle
impl Freeze for MembraneHandle
impl Move for MembraneHandle
impl RefUnwindSafe for MembraneHandle
impl Send for MembraneHandle
impl Sync for MembraneHandle
impl Unpin for MembraneHandle
impl UnsafeUnpin for MembraneHandle
impl UnwindSafe for MembraneHandle
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more