pub enum RenderCommandOutput<Custom> {
Element(RenderCommandOutputElement<Custom>),
ClipStart(RenderCommandClipStart),
ClipEnd(RenderCommandClipEnd),
}Expand description
One step in the layout-to-renderer command stream.
Emitted in depth-first tree order with z-index sorting applied per subtree root. Pipes translate each variant into renderer draw calls.
§Examples
use cotis::utils::ElementIdConfig;
use cotis_layout::layout_struct::{
RenderCommandClipEnd, RenderCommandClipStart, RenderCommandOutput,
RenderCommandOutputElement,
};
use cotis_utils::math::BoundingBox;
let id = ElementIdConfig::new_empty().get_handle();
let bounds = BoundingBox { x: 0.0, y: 0.0, width: 100.0, height: 50.0 };
let element: RenderCommandOutput<&str> = RenderCommandOutput::Element(RenderCommandOutputElement {
bounds,
z_index: 0,
text: None,
custom: "my-payload",
});
let clip_start: RenderCommandOutput<()> = RenderCommandOutput::ClipStart(RenderCommandClipStart {
bounds,
id: id.clone(),
z_index: 1,
});
let clip_end: RenderCommandOutput<()> = RenderCommandOutput::ClipEnd(RenderCommandClipEnd {
bounds,
id,
z_index: 1,
});
assert!(matches!(element, RenderCommandOutput::Element(_)));
assert!(matches!(clip_start, RenderCommandOutput::ClipStart(_)));
assert!(matches!(clip_end, RenderCommandOutput::ClipEnd(_)));Variants§
Element(RenderCommandOutputElement<Custom>)
A sized and positioned element ready for rendering.
ClipStart(RenderCommandClipStart)
Begin clip scissor for a scroll/clip container.
ClipEnd(RenderCommandClipEnd)
End clip scissor for a scroll/clip container.
Trait Implementations§
Source§impl<Custom: Clone> Clone for RenderCommandOutput<Custom>
impl<Custom: Clone> Clone for RenderCommandOutput<Custom>
Source§fn clone(&self) -> RenderCommandOutput<Custom>
fn clone(&self) -> RenderCommandOutput<Custom>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<Custom: Debug> Debug for RenderCommandOutput<Custom>
impl<Custom: Debug> Debug for RenderCommandOutput<Custom>
Source§impl<'frame, T> LayoutFrameManager<'frame, T, RenderCommandOutput<T>, CotisLayoutRun<'_, T>> for CotisLayoutRun<'_, T>where
T: CotisLayoutCompatible<'frame> + 'frame,
impl<'frame, T> LayoutFrameManager<'frame, T, RenderCommandOutput<T>, CotisLayoutRun<'_, T>> for CotisLayoutRun<'_, T>where
T: CotisLayoutCompatible<'frame> + 'frame,
Source§fn begin(&mut self) -> ConfiguredParentElement<'_, Self, T>
fn begin(&mut self) -> ConfiguredParentElement<'_, Self, T>
Begins configuration at the root of the UI tree for this frame.
Source§fn end(self) -> impl Iterator<Item = RenderCommandOutput<T>>
fn end(self) -> impl Iterator<Item = RenderCommandOutput<T>>
Completes frame construction and returns the frame output iterator.
Source§impl<'frame, T> LayoutManager<'frame, T, RenderCommandOutput<T>> for CotisLayoutManagerwhere
T: CotisLayoutCompatible<'frame> + 'frame,
impl<'frame, T> LayoutManager<'frame, T, RenderCommandOutput<T>> for CotisLayoutManagerwhere
T: CotisLayoutCompatible<'frame> + 'frame,
Source§type ElementConfigurer<'layout> = CotisLayoutRun<'layout, T>
where
Self: 'layout
type ElementConfigurer<'layout> = CotisLayoutRun<'layout, T> where Self: 'layout
The configurator type used while constructing one frame.
Source§fn begin_frame<'layout>(
&'layout mut self,
) -> impl LayoutFrameManager<'frame, T, RenderCommandOutput<T>, Self::ElementConfigurer<'layout>>where
T: 'frame,
RenderCommandOutput<T>: 'frame,
Self: 'layout,
fn begin_frame<'layout>(
&'layout mut self,
) -> impl LayoutFrameManager<'frame, T, RenderCommandOutput<T>, Self::ElementConfigurer<'layout>>where
T: 'frame,
RenderCommandOutput<T>: 'frame,
Self: 'layout,
Starts a new frame and returns a frame manager used to build UI.
Auto Trait Implementations§
impl<Custom> Freeze for RenderCommandOutput<Custom>where
Custom: Freeze,
impl<Custom> RefUnwindSafe for RenderCommandOutput<Custom>where
Custom: RefUnwindSafe,
impl<Custom> Send for RenderCommandOutput<Custom>where
Custom: Send,
impl<Custom> Sync for RenderCommandOutput<Custom>where
Custom: Sync,
impl<Custom> Unpin for RenderCommandOutput<Custom>where
Custom: Unpin,
impl<Custom> UnsafeUnpin for RenderCommandOutput<Custom>where
Custom: UnsafeUnpin,
impl<Custom> UnwindSafe for RenderCommandOutput<Custom>where
Custom: 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<H, TailTarget, Source, Idx> Embed<RenderTList<H, TailTarget>, There<Idx>> for Sourcewhere
TailTarget: IsRenderList,
Source: Embed<TailTarget, Idx>,
impl<H, TailTarget, Source, Idx> Embed<RenderTList<H, TailTarget>, There<Idx>> for Sourcewhere
TailTarget: IsRenderList,
Source: Embed<TailTarget, Idx>,
Source§fn embed(self) -> RenderTList<H, TailTarget>
fn embed(self) -> RenderTList<H, TailTarget>
Converts
self into Target.