pub struct CompatLockManager { /* private fields */ }Expand description
兼容性协商管理器 - 运行时使用
Implementations§
Source§impl CompatLockManager
impl CompatLockManager
Sourcepub async fn load(&mut self) -> Result<Option<&CompatLockFile>, CompatLockError>
pub async fn load(&mut self) -> Result<Option<&CompatLockFile>, CompatLockError>
加载 lock 文件
Sourcepub fn get_cached(&self) -> Option<&CompatLockFile>
pub fn get_cached(&self) -> Option<&CompatLockFile>
获取缓存的 lock 文件
Sourcepub async fn record_negotiation(
&mut self,
service_name: &str,
requested_fingerprint: &str,
resolved_fingerprint: &str,
is_exact_match: bool,
compatibility_check: CompatibilityCheck,
) -> Result<(), CompatLockError>
pub async fn record_negotiation( &mut self, service_name: &str, requested_fingerprint: &str, resolved_fingerprint: &str, is_exact_match: bool, compatibility_check: CompatibilityCheck, ) -> Result<(), CompatLockError>
记录协商结果
当发现服务时调用:
- 如果是精确匹配,尝试删除对应的协商记录
- 如果是兼容匹配,添加/更新协商记录
Sourcepub fn find_cached_compatible(
&self,
service_name: &str,
requested_fingerprint: &str,
) -> Option<&NegotiationEntry>
pub fn find_cached_compatible( &self, service_name: &str, requested_fingerprint: &str, ) -> Option<&NegotiationEntry>
查找已缓存的兼容版本(用于快速启动)
Auto Trait Implementations§
impl Freeze for CompatLockManager
impl RefUnwindSafe for CompatLockManager
impl Send for CompatLockManager
impl Sync for CompatLockManager
impl Unpin for CompatLockManager
impl UnwindSafe for CompatLockManager
Blanket Implementations§
Source§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
Mutably borrows from an owned value. Read more
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> ⓘ
Converts
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> ⓘ
Converts
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