pub struct GuestRuntime<P: Send + Sync + 'static> {
plugin: Arc<P>,
config: GuestRuntimeConfig,
log_bus: Option<Arc<LogBus>>,
}Expand description
Runtime for GuestPlugin implementations.
Runs a linear lifecycle per task: on_start -> execute_sample -> wait
-> on_stop, with auto-collection of artifacts and external logs.
Fields§
§plugin: Arc<P>§config: GuestRuntimeConfig§log_bus: Option<Arc<LogBus>>Implementations§
Source§impl<P: GuestPlugin> GuestRuntime<P>
impl<P: GuestPlugin> GuestRuntime<P>
Sourcepub fn with_config(plugin: P, config: GuestRuntimeConfig) -> Self
pub fn with_config(plugin: P, config: GuestRuntimeConfig) -> Self
Create a guest runtime with custom configuration.
Sourcepub fn with_log_bus(self, bus: Arc<LogBus>) -> Self
pub fn with_log_bus(self, bus: Arc<LogBus>) -> Self
Attach an externally-created [LogBus] so the gRPC log stream uses
the same bus that the tracing layer / C++ FFI already writes to.
Sourcepub fn run_blocking(self) -> Result<()>
pub fn run_blocking(self) -> Result<()>
Start the gRPC server, creating a tokio runtime if needed.
This is the entry point for fn main() style plugins that don’t
already have an async runtime.
Auto Trait Implementations§
impl<P> Freeze for GuestRuntime<P>
impl<P> RefUnwindSafe for GuestRuntime<P>where
P: RefUnwindSafe,
impl<P> Send for GuestRuntime<P>
impl<P> Sync for GuestRuntime<P>
impl<P> Unpin for GuestRuntime<P>
impl<P> UnsafeUnpin for GuestRuntime<P>
impl<P> UnwindSafe for GuestRuntime<P>where
P: RefUnwindSafe,
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].