pub struct Split<A> { /* private fields */ }Expand description
Runs one content encode and then many local adaptations.
The helper keeps device state out of the content encoder API. State is only
accepted by Split::adapt_many and the free drive function, both of
which operate on an already encoded EncodedScene.
Implementations§
Source§impl<A> Split<A>
impl<A> Split<A>
Sourcepub fn new(adapter: A, profile: DeviceProfile) -> Self
pub fn new(adapter: A, profile: DeviceProfile) -> Self
Builds a split driver for one local adapter and device profile.
Sourcepub fn profile(&self) -> &DeviceProfile
pub fn profile(&self) -> &DeviceProfile
Returns the device profile used for local adaptations.
Source§impl<A: LocalAdapter> Split<A>
impl<A: LocalAdapter> Split<A>
Sourcepub fn encode_once<C: SurfaceCodec + ?Sized>(
&self,
codec: &C,
cx: &mut Cx,
value: &Expr,
caps: &SurfaceCaps,
) -> Result<EncodedScene>
pub fn encode_once<C: SurfaceCodec + ?Sized>( &self, codec: &C, cx: &mut Cx, value: &Expr, caps: &SurfaceCaps, ) -> Result<EncodedScene>
Encodes content once through a SurfaceCodec.
Sourcepub fn adapt_one(
&self,
encoded: &EncodedScene,
state: &A::State,
) -> Result<Rc<Expr>>
pub fn adapt_one( &self, encoded: &EncodedScene, state: &A::State, ) -> Result<Rc<Expr>>
Adapts one already encoded Scene using the latest device state.
Sourcepub fn adapt_many(
&self,
encoded: &EncodedScene,
states: &[A::State],
) -> Result<Vec<Rc<Expr>>>
pub fn adapt_many( &self, encoded: &EncodedScene, states: &[A::State], ) -> Result<Vec<Rc<Expr>>>
Adapts one already encoded Scene for each device state.
Trait Implementations§
Auto Trait Implementations§
impl<A> Freeze for Split<A>where
A: Freeze,
impl<A> RefUnwindSafe for Split<A>where
A: RefUnwindSafe,
impl<A> Send for Split<A>where
A: Send,
impl<A> Sync for Split<A>where
A: Sync,
impl<A> Unpin for Split<A>where
A: Unpin,
impl<A> UnsafeUnpin for Split<A>where
A: UnsafeUnpin,
impl<A> UnwindSafe for Split<A>where
A: UnwindSafe,
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