pub struct JitController {
pub config: JitControllerConfig,
pub compiler: Arc<JitCompiler>,
/* private fields */
}Fields§
§config: JitControllerConfig§compiler: Arc<JitCompiler>Implementations§
Source§impl JitController
impl JitController
pub fn new(config: Value) -> Arc<Self> ⓘ
Sourcepub fn new_from_library(library: JitLibrary, cache_enabled: bool) -> Arc<Self> ⓘ
pub fn new_from_library(library: JitLibrary, cache_enabled: bool) -> Arc<Self> ⓘ
Create a JitController from an in-memory library.
pub async fn start(self: &Arc<Self>, client: CoordinatorClient)
Sourcepub async fn load_library(
self: &Arc<Self>,
library: JitLibrary,
) -> Result<(), Status>
pub async fn load_library( self: &Arc<Self>, library: JitLibrary, ) -> Result<(), Status>
Load a JIT library: register types with the JIT compiler AND forward
the underlying bin port/gadget types to the coordinator so that
subsequent execute calls can reference them. Used at start-time for
the initial library and at runtime for dynamically-loaded libraries
(e.g. from Python). Loading is additive — repeated calls accumulate.
pub fn next_ctype(&self) -> u64
pub fn next_etype(&self) -> u64
pub async fn clear_cache(&self)
Sourcepub async fn execute(self: &Arc<Self>, instruction: JitInstruction) -> u64
pub async fn execute(self: &Arc<Self>, instruction: JitInstruction) -> u64
Execute a JIT instruction, compiling it and sending commands to the coordinator.
Returns the assigned gid for the instantiated gadget once the gadget and check model are loaded. The error model is loaded asynchronously in the background to avoid circular dependencies (error models depend on future gadgets’ gids).
Sourcepub async fn batch_execute(
self: &Arc<Self>,
instructions: Vec<JitInstruction>,
) -> Result<Vec<u64>, BatchExecuteError>
pub async fn batch_execute( self: &Arc<Self>, instructions: Vec<JitInstruction>, ) -> Result<Vec<u64>, BatchExecuteError>
Execute multiple JIT instructions in batch, respecting dependencies between them.
All instructions must specify a non-zero gid. Dependencies (via connectors) are validated: referenced gids must either exist in this batch or have been previously executed. The entire batch is rejected if any validation fails.
Returns the gids in the same order as the input instructions.
§Errors
Returns BatchExecuteError if validation fails.
§Panics
Panics if any spawned task panics during execution.
Sourcepub async fn batch_decode(
self: &Arc<Self>,
outcomes: Vec<Outcomes>,
) -> Result<Vec<Readouts>, Status>
pub async fn batch_decode( self: &Arc<Self>, outcomes: Vec<Outcomes>, ) -> Result<Vec<Readouts>, Status>
Decode multiple gadgets concurrently.
All decode operations run in parallel, which is critical for window decoding where earlier decodes may depend on later ones. Returns readouts in the same order as the input outcomes.
§Errors
Returns tonic::Status if any decode operation fails.
§Panics
Panics if any spawned task panics during decoding.
pub async fn decode_single( self: &Arc<Self>, outcomes: Outcomes, ) -> Result<Readouts, Status>
Sourcepub async fn cancel_pending(&self)
pub async fn cancel_pending(&self)
Fire the cancellation token to abort any pending error-model loads and
in-flight decodes. Used by [crate::server::LocalServer::shutdown] to
propagate runtime shutdown into the service layer. Unlike Self::reset,
this does not wait for tasks to finish, does not refresh the token, and
does not clear caches — it just signals every cancellable point to bail.
pub async fn reset(self: &Arc<Self>, flags: ResetRequest) -> Result<(), Status>
Auto Trait Implementations§
impl !Freeze for JitController
impl !RefUnwindSafe for JitController
impl !UnwindSafe for JitController
impl Forget for JitController
impl Move for JitController
impl Send for JitController
impl Sync for JitController
impl Unpin for JitController
impl UnsafeUnpin for JitController
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 moreSource§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>
T in a tonic::Request