Skip to main content

RenderedSource

Struct RenderedSource 

Source
pub struct RenderedSource<R: SceneRenderer> { /* private fields */ }
Expand description

Default SceneSource implementation wrapping a scene + a renderer. Advances one frame per pull at the scene’s declared framerate; emits None when a finite scene’s last frame has been yielded.

Implementations§

Source§

impl<R: SceneRenderer> RenderedSource<R>

Source

pub fn new(scene: Scene, renderer: R) -> Self

Take ownership of scene + renderer. Does not call prepare on the renderer — that happens lazily on the first pull.

Source

pub fn scene(&self) -> &Scene

Access the underlying scene (read-only). Useful for tests + compositors that want to inspect state between pulls.

Source

pub fn scene_mut(&mut self) -> &mut Scene

Mutate the scene between pulls. The streaming-compositor use case uses this to apply Operations pulled from a control channel. Mid-stream mutations MUST NOT shift earlier timestamps — append-only operations (new keyframes after next_timestamp(), new objects, removed-in-future) are safe; rewriting existing keyframes is not.

Source

pub fn next_timestamp(&self) -> TimeStamp

Timestamp of the next frame to be pulled.

Trait Implementations§

Source§

impl<R: SceneRenderer> SceneSource for RenderedSource<R>

Source§

fn format(&self) -> SourceFormat

Declared format. Constant across a session.
Source§

fn pull(&mut self) -> Result<Option<RenderedFrame>>

Produce the next rendered tick. Returns Ok(None) when the source is exhausted (finite scene reached its end). For indefinite sources, this never returns None.

Auto Trait Implementations§

§

impl<R> Freeze for RenderedSource<R>
where R: Freeze,

§

impl<R> RefUnwindSafe for RenderedSource<R>
where R: RefUnwindSafe,

§

impl<R> Send for RenderedSource<R>
where R: Send,

§

impl<R> Sync for RenderedSource<R>
where R: Sync,

§

impl<R> Unpin for RenderedSource<R>
where R: Unpin,

§

impl<R> UnsafeUnpin for RenderedSource<R>
where R: UnsafeUnpin,

§

impl<R> UnwindSafe for RenderedSource<R>
where R: UnwindSafe,

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> 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, 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.