pub struct CdsService { /* private fields */ }Expand description
Cluster Discovery Service.
Implementations§
Source§impl CdsService
impl CdsService
Sourcepub fn new(cache: Arc<ShardedCache>, registry: Arc<ResourceRegistry>) -> Self
pub fn new(cache: Arc<ShardedCache>, registry: Arc<ResourceRegistry>) -> Self
Create a new CDS service.
Sourcepub fn new_with_handlers(
cache: Arc<ShardedCache>,
registry: Arc<ResourceRegistry>,
sotw_handler: Arc<SotwHandler>,
delta_handler: Arc<DeltaHandler>,
) -> Self
pub fn new_with_handlers( cache: Arc<ShardedCache>, registry: Arc<ResourceRegistry>, sotw_handler: Arc<SotwHandler>, delta_handler: Arc<DeltaHandler>, ) -> Self
Create a new CDS service with shared protocol handlers.
This allows sharing handlers across multiple services for better resource efficiency.
Sourcepub fn cache(&self) -> &ShardedCache
pub fn cache(&self) -> &ShardedCache
Get a reference to the cache.
Sourcepub fn registry(&self) -> &ResourceRegistry
pub fn registry(&self) -> &ResourceRegistry
Get a reference to the registry.
Sourcepub fn into_service(self) -> ClusterDiscoveryServiceServer<Self>
pub fn into_service(self) -> ClusterDiscoveryServiceServer<Self>
Convert this service into a tonic service for use with Server::add_service.
Trait Implementations§
Source§impl Clone for CdsService
impl Clone for CdsService
Source§impl ClusterDiscoveryService for CdsService
impl ClusterDiscoveryService for CdsService
Source§type StreamClustersStream = ReceiverStream<Result<DiscoveryResponse, Status>>
type StreamClustersStream = ReceiverStream<Result<DiscoveryResponse, Status>>
Server streaming response type for the StreamClusters method.
Source§type DeltaClustersStream = ReceiverStream<Result<DeltaDiscoveryResponse, Status>>
type DeltaClustersStream = ReceiverStream<Result<DeltaDiscoveryResponse, Status>>
Server streaming response type for the DeltaClusters method.
fn stream_clusters<'life0, 'async_trait>(
&'life0 self,
request: Request<Streaming<DiscoveryRequest>>,
) -> Pin<Box<dyn Future<Output = Result<Response<Self::StreamClustersStream>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delta_clusters<'life0, 'async_trait>(
&'life0 self,
request: Request<Streaming<DeltaDiscoveryRequest>>,
) -> Pin<Box<dyn Future<Output = Result<Response<Self::DeltaClustersStream>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn fetch_clusters<'life0, 'async_trait>(
&'life0 self,
request: Request<DiscoveryRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<DiscoveryResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Auto Trait Implementations§
impl !RefUnwindSafe for CdsService
impl !UnwindSafe for CdsService
impl Freeze for CdsService
impl Send for CdsService
impl Sync for CdsService
impl Unpin for CdsService
impl UnsafeUnpin for CdsService
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