Skip to main content

TailtriageController

Struct TailtriageController 

Source
pub struct TailtriageController { /* private fields */ }
Expand description

Long-lived live-capture controller for arm/disarm workflows.

Implementations§

Source§

impl TailtriageController

Source

pub fn builder(service_name: impl Into<String>) -> TailtriageControllerBuilder

Creates a builder for controller-level scaffolding.

Source

pub fn load_config_from_path( path: impl AsRef<Path>, ) -> Result<LoadedControllerConfig, ConfigLoadError>

Loads controller TOML config from path without mutating controller state.

This helper parses and returns the activation template that would be applied on reload/build.

§Errors

Returns ConfigLoadError when reading or parsing the TOML file fails.

Source

pub fn status(&self) -> TailtriageControllerStatus

Returns a status snapshot of controller lifecycle and template state.

Source

pub fn reload_template(&self, next_template: TailtriageControllerTemplate)

Replaces the template used to create the next activation generation.

This compatibility helper validates next_template and then applies it.

§Panics

Panics when template validation fails. Prefer TailtriageController::try_reload_template to handle validation errors explicitly.

Source

pub fn try_reload_template( &self, next_template: TailtriageControllerTemplate, ) -> Result<(), ReloadTemplateError>

Replaces the template used to create the next activation generation.

Unlike TailtriageController::reload_template, this method returns validation errors instead of panicking.

Validation matches the build-time checks done by TailtriageController::enable.

§Errors

Returns ReloadTemplateError when service_name is blank or when building a run with this template would fail.

Source

pub fn reload_config(&self) -> Result<(), ReloadConfigError>

Reloads controller config from the configured template file path.

Reload only updates the template for future activations. Any active generation keeps the activation config it started with.

§Errors

Returns ReloadConfigError when the controller has no config_path or when loading/parsing/validating the TOML file fails.

Source

pub fn enable(&self) -> Result<ActiveGenerationState, EnableError>

Arms capture by creating a fresh active generation with a bounded run.

§Errors

Returns EnableError::AlreadyActive when another generation is already active.

Returns EnableError::Build when constructing the generation run fails.

Returns EnableError::MissingTokioRuntimeForSampler when runtime sampler template startup is enabled but enable() is called outside an active Tokio runtime.

Returns EnableError::StartRuntimeSampler when runtime sampler startup is enabled but sampler initialization fails (for example, when config sets interval_ms = 0).

Source

pub fn disable(&self) -> Result<DisableOutcome, DisableError>

Disarms capture for the active generation.

This stops new request admissions immediately. If no admitted captured requests remain in flight, disarm finalizes immediately. Otherwise the generation is marked closing and finalization happens after the admitted captured requests drain.

§Errors

Returns DisableError::Finalize when final artifact writing fails.

Source

pub fn begin_request_with( &self, route: impl Into<String>, options: RequestOptions, ) -> ControllerStartedRequest

Begins one request through the controller.

When an active generation is still admitting requests, the returned tokens are bound to that generation.

When controller capture is disabled (or an active generation is closing), this returns inert/no-op request tokens.

Inert handles preserve explicit metadata from RequestOptions (request_id and kind). When request_id is omitted, the controller assigns a local fallback ID in inert-{N} form for predictable non-empty metadata.

Source

pub fn begin_request( &self, route: impl Into<String>, ) -> ControllerStartedRequest

Convenience helper using default request options.

Source

pub fn try_begin_request_with( &self, route: impl Into<String>, options: RequestOptions, ) -> Option<ControllerStartedRequest>

Tries to begin a captured request when an active generation is still admitting requests.

The returned handle and completion are generation-bound at admission time. They remain attached to that admitted generation even if the controller is disabled and re-enabled before completion finishes.

Returns None when controller is disabled or when active generation is closing.

Prefer TailtriageController::begin_request_with for the primary non-branching API.

Source

pub fn try_begin_request( &self, route: impl Into<String>, ) -> Option<ControllerStartedRequest>

Compatibility helper using default request options.

Prefer TailtriageController::begin_request for the primary non-branching API.

Source

pub fn shutdown(&self) -> Result<(), ShutdownError>

Finalizes controller state for process shutdown.

Shutdown makes lifecycle behavior explicit: it immediately stops new admissions and writes any active generation artifact, even if unfinished requests remain. That behavior matches tailtriage_core::Tailtriage::shutdown.

§Errors

Returns ShutdownError::Finalize if artifact writing fails.

Trait Implementations§

Source§

impl Clone for TailtriageController

Source§

fn clone(&self) -> TailtriageController

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TailtriageController

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.