pub struct LocalAdapterRegistry { /* private fields */ }Expand description
Directory of listener lease files.
Implementations§
Source§impl LocalAdapterRegistry
impl LocalAdapterRegistry
Sourcepub fn from_env() -> Self
pub fn from_env() -> Self
$SHADI_TMP_DIR/agentbridge-local, else <temp>/agentbridge-local.
Prefer SHADI_TMP_DIR so a sandboxed register can write the lease
under the same --write root as its mTLS material.
pub fn with_dir(dir: PathBuf) -> Self
pub fn dir(&self) -> &Path
Sourcepub fn publish(
&self,
record: &LocalAdapterRecord,
) -> Result<LocalAdapterLease, String>
pub fn publish( &self, record: &LocalAdapterRecord, ) -> Result<LocalAdapterLease, String>
Write a lease for record. Replaces a previous lease for the same
name+pid. The returned guard deletes the file on drop.
Sourcepub fn list_live(&self) -> Result<Vec<LocalAdapterRecord>, String>
pub fn list_live(&self) -> Result<Vec<LocalAdapterRecord>, String>
Live listeners only: skip unreadable files and delete leases whose process is gone.
Sourcepub fn find_live(&self, query: &str) -> Result<Vec<LocalAdapterRecord>, String>
pub fn find_live(&self, query: &str) -> Result<Vec<LocalAdapterRecord>, String>
Live listeners whose DID or adapter name matches query.
DID is the portable name. A tool name (copilot) is a local alias for
whatever DID currently holds that lease. Two live records with the
same DID or the same name are returned so the caller can treat them
as ambiguous.
Sourcepub fn resolve_live(&self, query: &str) -> Result<LocalAdapterRecord, String>
pub fn resolve_live(&self, query: &str) -> Result<LocalAdapterRecord, String>
Unique live listener for query, or an error if none / more than one.
Trait Implementations§
Source§impl Clone for LocalAdapterRegistry
impl Clone for LocalAdapterRegistry
Source§fn clone(&self) -> LocalAdapterRegistry
fn clone(&self) -> LocalAdapterRegistry
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for LocalAdapterRegistry
impl RefUnwindSafe for LocalAdapterRegistry
impl Send for LocalAdapterRegistry
impl Sync for LocalAdapterRegistry
impl Unpin for LocalAdapterRegistry
impl UnsafeUnpin for LocalAdapterRegistry
impl UnwindSafe for LocalAdapterRegistry
Blanket Implementations§
Source§impl<T> AnyExt for T
impl<T> AnyExt for T
Source§fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
T behind referenceSource§fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
T behind mutable referenceSource§fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
T behind Rc pointerSource§fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
T behind Arc pointerSource§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
fn coerce_rc_to(self: Rc<X>) -> Rc<T>
fn coerce_box_to(self: Box<X>) -> Box<T>
fn coerce_ref_to(&self) -> &T
fn coerce_mut_to(&mut self) -> &mut T
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request