Skip to main content

GuestService

Struct GuestService 

Source
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: u64

Trait Implementations§

Source§

impl<P: GuestPlugin> GuestPluginService for GuestService<P>

Source§

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>>

Server streaming response type for the PullFile method.
Source§

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>>

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,

Lifecycle management
Source§

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,

Source§

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,

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,

Guest access — file transfer and command execution on guest OS
Source§

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,

Source§

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,

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,

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> IntoRequest<T> for T

§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<L> LayerExt<L> for L

§

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].
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more