pub struct MeshService { /* private fields */ }Expand description
SystemService adapter for the K6 mesh transport.
The accept/connect loops are spawned by kernel boot (phase 5d) and handed
to this service (MeshService::adopt_tasks), which stops them on stop;
it owns the lifecycle surface: marking the mesh live,
disconnecting peers on stop, and aggregating peer-health into
HealthStatus for the weaver service registry.
Implementations§
Source§impl MeshService
impl MeshService
Sourcepub fn adopt_tasks(&self, handles: Vec<JoinHandle<()>>)
pub fn adopt_tasks(&self, handles: Vec<JoinHandle<()>>)
Take ownership of the mesh loops so stop can end them. stop is
terminal for these loops: start after stop does not respawn them.
Sourcepub fn new(runtime: Arc<MeshRuntime>) -> Self
pub fn new(runtime: Arc<MeshRuntime>) -> Self
Wrap an existing mesh runtime (listen endpoint unknown).
Sourcepub fn with_endpoints(
runtime: Arc<MeshRuntime>,
listen_addr: impl Into<String>,
transport: impl Into<String>,
) -> Self
pub fn with_endpoints( runtime: Arc<MeshRuntime>, listen_addr: impl Into<String>, transport: impl Into<String>, ) -> Self
Wrap a runtime with endpoint metadata from kernel mesh config.
Sourcepub fn runtime(&self) -> &Arc<MeshRuntime> ⓘ
pub fn runtime(&self) -> &Arc<MeshRuntime> ⓘ
Shared handle to the underlying mesh runtime.
Sourcepub fn is_started(&self) -> bool
pub fn is_started(&self) -> bool
Whether SystemService::start has been called more recently
than SystemService::stop.
Sourcepub fn listen_addr(&self) -> Option<&str>
pub fn listen_addr(&self) -> Option<&str>
Configured listen address, if provided at construction.
Sourcepub fn transport_name(&self) -> Option<&str>
pub fn transport_name(&self) -> Option<&str>
Configured transport name, if provided at construction.
Trait Implementations§
Source§impl Drop for MeshService
impl Drop for MeshService
Source§impl SystemService for MeshService
impl SystemService for MeshService
Source§fn service_type(&self) -> ServiceType
fn service_type(&self) -> ServiceType
Source§fn start<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn start<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn stop<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stop<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = HealthStatus> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = HealthStatus> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn liveness_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ProbeResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn liveness_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ProbeResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn readiness_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ProbeResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn readiness_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ProbeResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Auto Trait Implementations§
impl !Freeze for MeshService
impl !RefUnwindSafe for MeshService
impl !UnwindSafe for MeshService
impl Send for MeshService
impl Sync for MeshService
impl Unpin for MeshService
impl UnsafeUnpin for MeshService
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
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 more