pub struct TlsReloadAdapter<M> { /* private fields */ }Expand description
Bridges a ReloadableTargetTls implementor and the reload coordinator.
Created via TlsReloadAdapter::try_register. Holds the coordinator-
managed runtime state and exposes a zero-cost current_material() accessor
for the send hot-path.
Implementations§
Source§impl<M: Send + Sync + 'static> TlsReloadAdapter<M>
impl<M: Send + Sync + 'static> TlsReloadAdapter<M>
Sourcepub async fn try_register<T: ReloadableTargetTls<Material = M>>(
target: Arc<T>,
options: TlsReloadOptions,
coordinator: &TargetTlsReloadCoordinator,
) -> Option<Self>
pub async fn try_register<T: ReloadableTargetTls<Material = M>>( target: Arc<T>, options: TlsReloadOptions, coordinator: &TargetTlsReloadCoordinator, ) -> Option<Self>
Registers target with the coordinator and returns an adapter.
On success the coordinator has:
- built initial TLS material
- spawned a background poll loop
On failure returns None (the caller should keep its inline fallback
path intact — the target continues to work, just without coordinator
support).
Sourcepub fn current_material(&self) -> Arc<M> ⓘ
pub fn current_material(&self) -> Arc<M> ⓘ
Hot-path accessor: returns the current TLS material managed by the
coordinator. The returned Arc<M> is cheap to clone.
Sourcepub fn generation(&self) -> u64
pub fn generation(&self) -> u64
Returns the active generation counter.
Sourcepub fn status_snapshot(&self) -> TargetTlsStatusSnapshot
pub fn status_snapshot(&self) -> TargetTlsStatusSnapshot
Returns a read-only status snapshot for admin/observability.
Sourcepub fn runtime_state(&self) -> &Arc<TargetTlsRuntimeState<M>> ⓘ
pub fn runtime_state(&self) -> &Arc<TargetTlsRuntimeState<M>> ⓘ
Returns the underlying runtime state (for close() cleanup etc.).
Sourcepub async fn unregister(&self, coordinator: &TargetTlsReloadCoordinator)
pub async fn unregister(&self, coordinator: &TargetTlsReloadCoordinator)
Unregisters from the coordinator (stops the poll loop).
Trait Implementations§
Source§impl<M> Clone for TlsReloadAdapter<M>
impl<M> Clone for TlsReloadAdapter<M>
Auto Trait Implementations§
impl<M> !RefUnwindSafe for TlsReloadAdapter<M>
impl<M> !UnwindSafe for TlsReloadAdapter<M>
impl<M> Freeze for TlsReloadAdapter<M>
impl<M> Send for TlsReloadAdapter<M>
impl<M> Sync for TlsReloadAdapter<M>
impl<M> Unpin for TlsReloadAdapter<M>
impl<M> UnsafeUnpin for TlsReloadAdapter<M>
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
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> 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