Skip to main content

TrainingViewerSource

Struct TrainingViewerSource 

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

Non-owning TrainingSession dashboard source for Viewer live mode.

Donor: oa::TrainingViewerSource.

Implementations§

Source§

impl TrainingViewerSource

Source

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.

Source

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.

Source

pub const fn config(&self) -> &TrainingViewerConfig

Return the normalized dashboard configuration.

Source

pub fn latest_snapshot(&self) -> Option<TrainingSessionSnapshot>

Return the latest session snapshot observed by the dashboard.

Source

pub fn latest_preview(&self) -> Option<TrainingPreviewFrame>

Return the latest promoted preview frame, if any.

Source

pub fn metric_series_count(&self) -> u32

Return the number of retained metric series.

Source

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

Source§

fn capabilities(&self) -> ViewerLiveCapabilities

Source§

fn open(&mut self, _engine: &Engine) -> Result<()>

Called once when the Viewer obtains an Engine.
Source§

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

Per-frame update. delta_ms is the frame time in milliseconds.
Source§

fn render(&mut self, ui: &mut Ui<'_>, width: u32, height: u32) -> Result<()>

Render domain-specific UI overlays into ui. Called every frame.
Source§

fn close(&mut self) -> Result<()>

Called once when the Viewer is closing.
Source§

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

fn canvas_controls_rect( &self, _width: u32, _height: u32, _scale: f32, ) -> Option<PixelRect>

Source controls that own pointer gesture starts over the canvas. Motion and release from an existing canvas drag still reach Navigation.

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<S> FromSample<S> for S

Source§

fn from_sample_(s: S) -> S

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<F, T> IntoSample<T> for F
where T: FromSample<F>,

Source§

fn into_sample(self) -> T

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

Source§

fn to_sample_(self) -> U

Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.