pub struct ServiceState {
pub cache: Arc<ShardedCache>,
pub registry: Arc<ResourceRegistry>,
pub config: Arc<ServerConfig>,
pub sotw: Arc<SotwHandler>,
pub delta: Arc<DeltaHandler>,
}Expand description
Shared state for all xDS services.
Fields§
§cache: Arc<ShardedCache>Shared cache.
registry: Arc<ResourceRegistry>Resource registry.
config: Arc<ServerConfig>Server configuration.
sotw: Arc<SotwHandler>SotW handler.
delta: Arc<DeltaHandler>Delta handler.
Implementations§
Source§impl ServiceState
impl ServiceState
Sourcepub fn new(
cache: Arc<ShardedCache>,
registry: Arc<ResourceRegistry>,
config: ServerConfig,
) -> Self
pub fn new( cache: Arc<ShardedCache>, registry: Arc<ResourceRegistry>, config: ServerConfig, ) -> Self
Create new service state.
Sourcepub fn create_services(
&self,
) -> (AdsService, CdsService, LdsService, RdsService, EdsService, SdsService)
pub fn create_services( &self, ) -> (AdsService, CdsService, LdsService, RdsService, EdsService, SdsService)
Create all discovery services from this state.
Services share the SotW handler from this state for better resource efficiency instead of creating individual handlers.
Trait Implementations§
Source§impl Clone for ServiceState
impl Clone for ServiceState
Auto Trait Implementations§
impl !RefUnwindSafe for ServiceState
impl !UnwindSafe for ServiceState
impl Freeze for ServiceState
impl Send for ServiceState
impl Sync for ServiceState
impl Unpin for ServiceState
impl UnsafeUnpin for ServiceState
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> 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> 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