pub struct ImagegenRuntime { /* private fields */ }Expand description
Provider-neutral execution engine shared by CLI, HTTP, and libraries.
Implementations§
Source§impl ImagegenRuntime
impl ImagegenRuntime
Sourcepub fn new(
registry: ProviderRegistry,
config: RuntimeConfig,
) -> Result<Self, BridgeError>
pub fn new( registry: ProviderRegistry, config: RuntimeConfig, ) -> Result<Self, BridgeError>
Validates configuration and constructs all fixed-capacity runtime state.
Sourcepub const fn registry(&self) -> &ProviderRegistry
pub const fn registry(&self) -> &ProviderRegistry
Returns the immutable provider registry.
Sourcepub fn validate_request(
&self,
request: &ImageRequest,
) -> Result<(), BridgeError>
pub fn validate_request( &self, request: &ImageRequest, ) -> Result<(), BridgeError>
Validates intrinsic request bounds without starting provider work.
Sourcepub const fn has_artifact_store(&self) -> bool
pub const fn has_artifact_store(&self) -> bool
Whether verified bridge-owned artifact delivery is available.
Sourcepub fn read_artifact(
&self,
artifact_id: &str,
) -> Result<StoredArtifactContent, BridgeError>
pub fn read_artifact( &self, artifact_id: &str, ) -> Result<StoredArtifactContent, BridgeError>
Reads one ownership-verified artifact for authenticated delivery.
Sourcepub fn read_artifact_thumbnail(
&self,
artifact_id: &str,
maximum_edge: u32,
) -> Result<Vec<u8>, BridgeError>
pub fn read_artifact_thumbnail( &self, artifact_id: &str, maximum_edge: u32, ) -> Result<Vec<u8>, BridgeError>
Creates a bounded PNG thumbnail from one ownership-verified artifact.
Sourcepub async fn execute(
&self,
request: ImageRequest,
) -> Result<ImageResponse, BridgeError>
pub async fn execute( &self, request: ImageRequest, ) -> Result<ImageResponse, BridgeError>
Executes with generated request metadata and the default idempotency scope.
Sourcepub async fn execute_with(
&self,
request: ImageRequest,
context: ExecutionContext,
) -> Result<ImageResponse, BridgeError>
pub async fn execute_with( &self, request: ImageRequest, context: ExecutionContext, ) -> Result<ImageResponse, BridgeError>
Executes the complete validation, negotiation, admission, provider, and materialization pipeline.
Sourcepub async fn execute_with_events(
&self,
request: ImageRequest,
context: ExecutionContext,
events: Sender<ProviderEvent>,
) -> Result<ImageResponse, BridgeError>
pub async fn execute_with_events( &self, request: ImageRequest, context: ExecutionContext, events: Sender<ProviderEvent>, ) -> Result<ImageResponse, BridgeError>
Executes the complete pipeline and forwards bounded provider events.
Sourcepub fn queue_snapshot(&self) -> RuntimeQueueSnapshot
pub fn queue_snapshot(&self) -> RuntimeQueueSnapshot
Returns current bounded queue depth without request identifiers.
Sourcepub async fn shutdown(&self) -> Result<(), BridgeError>
pub async fn shutdown(&self) -> Result<(), BridgeError>
Stops admissions, cancels active operations, and releases providers.