pub struct SshConfigCache { /* private fields */ }Expand description
Thread-safe LRU cache for SSH configurations
Implementations§
Source§impl SshConfigCache
impl SshConfigCache
Sourcepub fn with_config(config: CacheConfig) -> Self
pub fn with_config(config: CacheConfig) -> Self
Create a new SSH config cache with custom configuration
Sourcepub async fn get_or_load<P: AsRef<Path>>(&self, path: P) -> Result<SshConfig>
pub async fn get_or_load<P: AsRef<Path>>(&self, path: P) -> Result<SshConfig>
Get an SSH config from cache or load it from file
Sourcepub async fn load_default(&self) -> Result<SshConfig>
pub async fn load_default(&self) -> Result<SshConfig>
Load SSH config from default locations with caching
Sourcepub async fn remove<P: AsRef<Path>>(&self, path: P) -> Result<Option<SshConfig>>
pub async fn remove<P: AsRef<Path>>(&self, path: P) -> Result<Option<SshConfig>>
Remove a specific entry from the cache
Sourcepub fn stats(&self) -> Result<CacheStats>
pub fn stats(&self) -> Result<CacheStats>
Get current cache statistics
Sourcepub fn config(&self) -> &CacheConfig
pub fn config(&self) -> &CacheConfig
Get cache configuration
Sourcepub fn update_config(&mut self, new_config: CacheConfig)
pub fn update_config(&mut self, new_config: CacheConfig)
Update cache configuration (will clear cache if max_entries changed)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SshConfigCache
impl RefUnwindSafe for SshConfigCache
impl Send for SshConfigCache
impl Sync for SshConfigCache
impl Unpin for SshConfigCache
impl UnsafeUnpin for SshConfigCache
impl UnwindSafe for SshConfigCache
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> 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 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>
Wrap the input message
T in a tonic::Request