struct GuestService<P: Send + Sync + 'static> {
plugin: Arc<P>,
shutdown_tx: Mutex<Option<Sender<()>>>,
sample_dir: PathBuf,
artifact_dir: PathBuf,
external_log_dir: PathBuf,
log_bus: Arc<LogBus>,
stash: Arc<ResultStash>,
auto_collect_artifacts: AutoCollectSection,
auto_collect_external_logs: AutoCollectSection,
default_timeout: u64,
}Expand description
Internal gRPC service implementation that delegates RPCs to a GuestPlugin.
Fields§
§plugin: Arc<P>§shutdown_tx: Mutex<Option<Sender<()>>>§sample_dir: PathBuf§artifact_dir: PathBuf§external_log_dir: PathBuf§log_bus: Arc<LogBus>§stash: Arc<ResultStash>§auto_collect_artifacts: AutoCollectSection§auto_collect_external_logs: AutoCollectSection§default_timeout: u64Trait Implementations§
Source§impl<P: GuestPlugin> GuestPluginService for GuestService<P>
impl<P: GuestPlugin> GuestPluginService for GuestService<P>
Source§type ExecuteTaskStream = Pin<Box<dyn Stream<Item = Result<TaskResult, Status>> + Send>>
type ExecuteTaskStream = Pin<Box<dyn Stream<Item = Result<TaskResult, Status>> + Send>>
Server streaming response type for the ExecuteTask method.
Source§type PullFileStream = Pin<Box<dyn Stream<Item = Result<FileChunk, Status>> + Send>>
type PullFileStream = Pin<Box<dyn Stream<Item = Result<FileChunk, Status>> + Send>>
Server streaming response type for the PullFile method.
Source§type StreamLogsStream = Pin<Box<dyn Stream<Item = Result<LogEntry, Status>> + Send>>
type StreamLogsStream = Pin<Box<dyn Stream<Item = Result<LogEntry, Status>> + Send>>
Server streaming response type for the StreamLogs method.
Source§type PullResultStream = Pin<Box<dyn Stream<Item = Result<ResultChunk, Status>> + Send>>
type PullResultStream = Pin<Box<dyn Stream<Item = Result<ResultChunk, Status>> + Send>>
Server streaming response type for the PullResult method.
Source§fn initialize<'life0, 'async_trait>(
&'life0 self,
_request: Request<InitializeRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<InitializeResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn initialize<'life0, 'async_trait>(
&'life0 self,
_request: Request<InitializeRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<InitializeResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Lifecycle management
fn health_check<'life0, 'async_trait>(
&'life0 self,
_request: Request<HealthCheckRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<HealthCheckResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn shutdown<'life0, 'async_trait>(
&'life0 self,
_request: Request<ShutdownRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<ShutdownResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn execute_task<'life0, 'async_trait>(
&'life0 self,
request: Request<TaskRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<Self::ExecuteTaskStream>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute_task<'life0, 'async_trait>(
&'life0 self,
request: Request<TaskRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<Self::ExecuteTaskStream>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Task execution — daemon sends task, guest streams results back
Source§fn push_file<'life0, 'async_trait>(
&'life0 self,
request: Request<Streaming<FileChunk>>,
) -> Pin<Box<dyn Future<Output = Result<Response<FileTransferResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn push_file<'life0, 'async_trait>(
&'life0 self,
request: Request<Streaming<FileChunk>>,
) -> Pin<Box<dyn Future<Output = Result<Response<FileTransferResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Guest access — file transfer and command execution on guest OS
fn pull_file<'life0, 'async_trait>(
&'life0 self,
request: Request<PullFileRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<Self::PullFileStream>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute_command<'life0, 'async_trait>(
&'life0 self,
_request: Request<ExecRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<ExecResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn stream_logs<'life0, 'async_trait>(
&'life0 self,
request: Request<LogStreamRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<Self::StreamLogsStream>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stream_logs<'life0, 'async_trait>(
&'life0 self,
request: Request<LogStreamRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<Self::StreamLogsStream>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Log streaming — daemon pulls logs from guest plugin
Source§fn pull_result<'life0, 'async_trait>(
&'life0 self,
request: Request<PullResultRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<Self::PullResultStream>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn pull_result<'life0, 'async_trait>(
&'life0 self,
request: Request<PullResultRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<Self::PullResultStream>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Large result transfer — daemon pulls stashed results by opaque handle
Auto Trait Implementations§
impl<P> !Freeze for GuestService<P>
impl<P> RefUnwindSafe for GuestService<P>where
P: RefUnwindSafe,
impl<P> Send for GuestService<P>
impl<P> Sync for GuestService<P>
impl<P> Unpin for GuestService<P>
impl<P> UnsafeUnpin for GuestService<P>
impl<P> UnwindSafe for GuestService<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].