pub struct TrainingViewerSource { /* private fields */ }Expand description
Non-owning TrainingSession dashboard source for Viewer live mode.
Donor: oa::TrainingViewerSource.
Implementations§
Source§impl TrainingViewerSource
impl TrainingViewerSource
Sourcepub fn new(session: &TrainingSession, config: TrainingViewerConfig) -> Self
pub fn new(session: &TrainingSession, config: TrainingViewerConfig) -> Self
Attach to session. The handle is shared, not owned: enqueueing and
snapshot reads never block the training thread.
Sourcepub fn publish_preview(&self, frame: TrainingPreviewFrame) -> Result<()>
pub fn publish_preview(&self, frame: TrainingPreviewFrame) -> Result<()>
Publish one preview frame; an incomplete producer event defers
promotion until the next update observes completion.
§Errors
Returns ErrorKind::InvalidArgument when the frame has no texture.
Sourcepub const fn config(&self) -> &TrainingViewerConfig
pub const fn config(&self) -> &TrainingViewerConfig
Return the normalized dashboard configuration.
Sourcepub fn latest_snapshot(&self) -> Option<TrainingSessionSnapshot>
pub fn latest_snapshot(&self) -> Option<TrainingSessionSnapshot>
Return the latest session snapshot observed by the dashboard.
Sourcepub fn latest_preview(&self) -> Option<TrainingPreviewFrame>
pub fn latest_preview(&self) -> Option<TrainingPreviewFrame>
Return the latest promoted preview frame, if any.
Sourcepub fn metric_series_count(&self) -> u32
pub fn metric_series_count(&self) -> u32
Return the number of retained metric series.
Sourcepub fn metric_sample_count(&self, name: &str) -> u32
pub fn metric_sample_count(&self, name: &str) -> u32
Return the retained sample count for the series named name.
Trait Implementations§
Source§impl ViewerLiveSource for TrainingViewerSource
impl ViewerLiveSource for TrainingViewerSource
fn capabilities(&self) -> ViewerLiveCapabilities
Source§fn open(&mut self, _runtime: &Runtime) -> Result<()>
fn open(&mut self, _runtime: &Runtime) -> Result<()>
Called once when the Viewer obtains an
Runtime.Source§fn on_event(&mut self, event: &InputEvent) -> Result<()>
fn on_event(&mut self, event: &InputEvent) -> Result<()>
Raw platform event (only called when
receives_events is true).Source§fn update(&mut self, delta_ms: f32) -> Result<()>
fn update(&mut self, delta_ms: f32) -> Result<()>
Per-frame update.
delta_ms is the frame time in milliseconds.Source§fn render(&mut self, ui: &mut Ui<'_>, width: u32, height: u32) -> Result<()>
fn render(&mut self, ui: &mut Ui<'_>, width: u32, height: u32) -> Result<()>
Render domain-specific UI overlays into
ui. Called every frame.Source§fn canvas_texture(&self) -> Option<&Texture>
fn canvas_texture(&self) -> Option<&Texture>
Optional camera/image surface presented by the Viewer’s shared GPU 2D
canvas. The Viewer owns navigation, fit, zoom, pan and channel selection;
render draws only the source’s overlays when this is provided.Auto Trait Implementations§
impl !Freeze for TrainingViewerSource
impl !RefUnwindSafe for TrainingViewerSource
impl !Send for TrainingViewerSource
impl !Sync for TrainingViewerSource
impl !UnwindSafe for TrainingViewerSource
impl Forget for TrainingViewerSource
impl Move for TrainingViewerSource
impl Unpin for TrainingViewerSourcewhere
Arc<Shared>: Unpin,
*const u8 is !null: Unpin,
Box<dyn FnMut()>: Unpin,
Align4<u32>: Unpin,
Align1<u8>: Unpin,
Rc<RefCell<RuntimeState>>: Unpin,
Rc<StorageInner>: Unpin,
Rc<MatrixSemantic>: Unpin,
Rc<()>: Unpin,
Rc<NativeRgbaImage>: Unpin,
Rc<RefCell<RendererState>>: Unpin,
Rc<TextureSemantic>: Unpin,
Arc<Device>: Unpin,
Arc<RetirementCompletion>: Unpin,
Arc<WorkerControl>: Unpin,
Arc<TimestampPairInner>: Unpin,
Arc<Mutex<Vec<Arc<DecodeStatus>>>>: Unpin,
Arc<Mutex<Vec<Arc<EncodeReceipt>>>>: Unpin,
impl UnsafeUnpin for TrainingViewerSourcewhere
*const ArcInner<Shared> is !null: UnsafeUnpin,
PhantomData<ArcInner<Shared>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<KeyAction>: UnsafeUnpin,
PhantomData<TrainingMetricSample>: UnsafeUnpin,
PhantomData<Series>: UnsafeUnpin,
Align4<u32>: UnsafeUnpin,
Align1<u8>: UnsafeUnpin,
*const RcInner<RefCell<RuntimeState>> is !null: UnsafeUnpin,
PhantomData<RcInner<RefCell<RuntimeState>>>: UnsafeUnpin,
*const RcInner<StorageInner> is !null: UnsafeUnpin,
PhantomData<RcInner<StorageInner>>: UnsafeUnpin,
PhantomData<usize>: UnsafeUnpin,
*const RcInner<MatrixSemantic> is !null: UnsafeUnpin,
PhantomData<RcInner<MatrixSemantic>>: UnsafeUnpin,
PhantomData<Rc<()>>: UnsafeUnpin,
*const RcInner<NativeRgbaImage> is !null: UnsafeUnpin,
PhantomData<RcInner<NativeRgbaImage>>: UnsafeUnpin,
*const RcInner<RefCell<RendererState>> is !null: UnsafeUnpin,
PhantomData<RcInner<RefCell<RendererState>>>: UnsafeUnpin,
*const RcInner<TextureSemantic> is !null: UnsafeUnpin,
PhantomData<RcInner<TextureSemantic>>: UnsafeUnpin,
*const ArcInner<Device> is !null: UnsafeUnpin,
PhantomData<ArcInner<Device>>: UnsafeUnpin,
*const ArcInner<RetirementCompletion> is !null: UnsafeUnpin,
PhantomData<ArcInner<RetirementCompletion>>: UnsafeUnpin,
*const ArcInner<WorkerControl> is !null: UnsafeUnpin,
PhantomData<ArcInner<WorkerControl>>: UnsafeUnpin,
*const ArcInner<TimestampPairInner> is !null: UnsafeUnpin,
PhantomData<ArcInner<TimestampPairInner>>: UnsafeUnpin,
*const ArcInner<Mutex<Vec<Arc<DecodeStatus>>>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Mutex<Vec<Arc<DecodeStatus>>>>>: UnsafeUnpin,
*const ArcInner<Mutex<Vec<Arc<EncodeReceipt>>>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Mutex<Vec<Arc<EncodeReceipt>>>>>: UnsafeUnpin,
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